Updated the files.
This commit is contained in:
parent
1553e6b971
commit
753967d4f5
23418 changed files with 3784666 additions and 0 deletions
5
my-app/node_modules/source-map-loader/dist/cjs.js
generated
vendored
Executable file
5
my-app/node_modules/source-map-loader/dist/cjs.js
generated
vendored
Executable file
|
|
@ -0,0 +1,5 @@
|
|||
"use strict";
|
||||
|
||||
const loader = require("./index");
|
||||
module.exports = loader.default;
|
||||
module.exports.raw = loader.raw;
|
||||
128
my-app/node_modules/source-map-loader/dist/index.js
generated
vendored
Executable file
128
my-app/node_modules/source-map-loader/dist/index.js
generated
vendored
Executable file
|
|
@ -0,0 +1,128 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = loader;
|
||||
var _path = _interopRequireDefault(require("path"));
|
||||
var _options = _interopRequireDefault(require("./options.json"));
|
||||
var _utils = require("./utils");
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
/*
|
||||
MIT License http://www.opensource.org/licenses/mit-license.php
|
||||
Author Tobias Koppers @sokra
|
||||
*/
|
||||
|
||||
async function loader(input, inputMap) {
|
||||
const options = this.getOptions(_options.default);
|
||||
const {
|
||||
sourceMappingURL,
|
||||
replacementString
|
||||
} = (0, _utils.getSourceMappingURL)(input);
|
||||
const callback = this.async();
|
||||
if (!sourceMappingURL) {
|
||||
callback(null, input, inputMap);
|
||||
return;
|
||||
}
|
||||
let behaviourSourceMappingUrl;
|
||||
try {
|
||||
behaviourSourceMappingUrl = typeof options.filterSourceMappingUrl !== "undefined" ? options.filterSourceMappingUrl(sourceMappingURL, this.resourcePath) : "consume";
|
||||
} catch (error) {
|
||||
callback(error);
|
||||
return;
|
||||
}
|
||||
|
||||
// eslint-disable-next-line default-case
|
||||
switch (behaviourSourceMappingUrl) {
|
||||
case "skip":
|
||||
callback(null, input, inputMap);
|
||||
return;
|
||||
case false:
|
||||
case "remove":
|
||||
callback(null, input.replace(replacementString, ""), inputMap);
|
||||
return;
|
||||
}
|
||||
let sourceURL;
|
||||
let sourceContent;
|
||||
try {
|
||||
({
|
||||
sourceURL,
|
||||
sourceContent
|
||||
} = await (0, _utils.fetchFromURL)(this, this.context, sourceMappingURL));
|
||||
} catch (error) {
|
||||
this.emitWarning(error);
|
||||
callback(null, input, inputMap);
|
||||
return;
|
||||
}
|
||||
if (sourceURL) {
|
||||
this.addDependency(sourceURL);
|
||||
}
|
||||
let map;
|
||||
try {
|
||||
map = JSON.parse(sourceContent.replace(/^\)\]\}'/, ""));
|
||||
} catch (parseError) {
|
||||
this.emitWarning(new Error(`Failed to parse source map from '${sourceMappingURL}': ${parseError}`));
|
||||
callback(null, input, inputMap);
|
||||
return;
|
||||
}
|
||||
const context = sourceURL ? _path.default.dirname(sourceURL) : this.context;
|
||||
if (map.sections) {
|
||||
// eslint-disable-next-line no-param-reassign
|
||||
map = await (0, _utils.flattenSourceMap)(map);
|
||||
}
|
||||
const resolvedSources = await Promise.all(map.sources.map(async (source, i) => {
|
||||
// eslint-disable-next-line no-shadow
|
||||
let sourceURL;
|
||||
// eslint-disable-next-line no-shadow
|
||||
let sourceContent;
|
||||
const originalSourceContent = map.sourcesContent && typeof map.sourcesContent[i] !== "undefined" && map.sourcesContent[i] !== null ? map.sourcesContent[i] :
|
||||
// eslint-disable-next-line no-undefined
|
||||
undefined;
|
||||
const skipReading = typeof originalSourceContent !== "undefined";
|
||||
let errored = false;
|
||||
|
||||
// We do not skipReading here, because we need absolute paths in sources.
|
||||
// This is necessary so that for sourceMaps with the same file structure in sources, name collisions do not occur.
|
||||
// https://github.com/webpack-contrib/source-map-loader/issues/51
|
||||
try {
|
||||
({
|
||||
sourceURL,
|
||||
sourceContent
|
||||
} = await (0, _utils.fetchFromURL)(this, context, source, map.sourceRoot, skipReading));
|
||||
} catch (error) {
|
||||
errored = true;
|
||||
this.emitWarning(error);
|
||||
}
|
||||
if (skipReading) {
|
||||
sourceContent = originalSourceContent;
|
||||
} else if (!errored && sourceURL && !(0, _utils.isURL)(sourceURL)) {
|
||||
this.addDependency(sourceURL);
|
||||
}
|
||||
|
||||
// Return original value of `source` when error happens
|
||||
return {
|
||||
sourceURL: errored ? source : sourceURL,
|
||||
sourceContent
|
||||
};
|
||||
}));
|
||||
const newMap = {
|
||||
...map
|
||||
};
|
||||
newMap.sources = [];
|
||||
newMap.sourcesContent = [];
|
||||
delete newMap.sourceRoot;
|
||||
resolvedSources.forEach(source => {
|
||||
// eslint-disable-next-line no-shadow
|
||||
const {
|
||||
sourceURL,
|
||||
sourceContent
|
||||
} = source;
|
||||
newMap.sources.push(sourceURL || "");
|
||||
newMap.sourcesContent.push(sourceContent || "");
|
||||
});
|
||||
const sourcesContentIsEmpty = newMap.sourcesContent.filter(entry => Boolean(entry)).length === 0;
|
||||
if (sourcesContentIsEmpty) {
|
||||
delete newMap.sourcesContent;
|
||||
}
|
||||
callback(null, input.replace(replacementString, ""), newMap);
|
||||
}
|
||||
214
my-app/node_modules/source-map-loader/dist/labels-to-names.js
generated
vendored
Executable file
214
my-app/node_modules/source-map-loader/dist/labels-to-names.js
generated
vendored
Executable file
|
|
@ -0,0 +1,214 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = void 0;
|
||||
const labelToNames = {
|
||||
866: "IBM866",
|
||||
"unicode-1-1-utf-8": "UTF-8",
|
||||
"utf-8": "UTF-8",
|
||||
utf8: "UTF-8",
|
||||
cp866: "IBM866",
|
||||
csibm866: "IBM866",
|
||||
ibm866: "IBM866",
|
||||
csisolatin2: "ISO-8859-2",
|
||||
"iso-8859-2": "ISO-8859-2",
|
||||
"iso-ir-101": "ISO-8859-2",
|
||||
"iso8859-2": "ISO-8859-2",
|
||||
iso88592: "ISO-8859-2",
|
||||
"iso_8859-2": "ISO-8859-2",
|
||||
"iso_8859-2:1987": "ISO-8859-2",
|
||||
l2: "ISO-8859-2",
|
||||
latin2: "ISO-8859-2",
|
||||
csisolatin3: "ISO-8859-3",
|
||||
"iso-8859-3": "ISO-8859-3",
|
||||
"iso-ir-109": "ISO-8859-3",
|
||||
"iso8859-3": "ISO-8859-3",
|
||||
iso88593: "ISO-8859-3",
|
||||
"iso_8859-3": "ISO-8859-3",
|
||||
"iso_8859-3:1988": "ISO-8859-3",
|
||||
l3: "ISO-8859-3",
|
||||
latin3: "ISO-8859-3",
|
||||
csisolatin4: "ISO-8859-4",
|
||||
"iso-8859-4": "ISO-8859-4",
|
||||
"iso-ir-110": "ISO-8859-4",
|
||||
"iso8859-4": "ISO-8859-4",
|
||||
iso88594: "ISO-8859-4",
|
||||
"iso_8859-4": "ISO-8859-4",
|
||||
"iso_8859-4:1988": "ISO-8859-4",
|
||||
l4: "ISO-8859-4",
|
||||
latin4: "ISO-8859-4",
|
||||
csisolatincyrillic: "ISO-8859-5",
|
||||
cyrillic: "ISO-8859-5",
|
||||
"iso-8859-5": "ISO-8859-5",
|
||||
"iso-ir-144": "ISO-8859-5",
|
||||
"iso8859-5": "ISO-8859-5",
|
||||
iso88595: "ISO-8859-5",
|
||||
"iso_8859-5": "ISO-8859-5",
|
||||
"iso_8859-5:1988": "ISO-8859-5",
|
||||
arabic: "ISO-8859-6",
|
||||
"asmo-708": "ISO-8859-6",
|
||||
csiso88596e: "ISO-8859-6",
|
||||
csiso88596i: "ISO-8859-6",
|
||||
csisolatinarabic: "ISO-8859-6",
|
||||
"ecma-114": "ISO-8859-6",
|
||||
"iso-8859-6": "ISO-8859-6",
|
||||
"iso-8859-6-e": "ISO-8859-6",
|
||||
"iso-8859-6-i": "ISO-8859-6",
|
||||
"iso-ir-127": "ISO-8859-6",
|
||||
"iso8859-6": "ISO-8859-6",
|
||||
iso88596: "ISO-8859-6",
|
||||
"iso_8859-6": "ISO-8859-6",
|
||||
"iso_8859-6:1987": "ISO-8859-6",
|
||||
csisolatingreek: "ISO-8859-7",
|
||||
"ecma-118": "ISO-8859-7",
|
||||
elot_928: "ISO-8859-7",
|
||||
greek: "ISO-8859-7",
|
||||
greek8: "ISO-8859-7",
|
||||
"iso-8859-7": "ISO-8859-7",
|
||||
"iso-ir-126": "ISO-8859-7",
|
||||
"iso8859-7": "ISO-8859-7",
|
||||
iso88597: "ISO-8859-7",
|
||||
"iso_8859-7": "ISO-8859-7",
|
||||
"iso_8859-7:1987": "ISO-8859-7",
|
||||
sun_eu_greek: "ISO-8859-7",
|
||||
csiso88598e: "ISO-8859-8",
|
||||
csisolatinhebrew: "ISO-8859-8",
|
||||
hebrew: "ISO-8859-8",
|
||||
"iso-8859-8": "ISO-8859-8",
|
||||
"iso-8859-8-e": "ISO-8859-8",
|
||||
"iso-ir-138": "ISO-8859-8",
|
||||
"iso8859-8": "ISO-8859-8",
|
||||
iso88598: "ISO-8859-8",
|
||||
"iso_8859-8": "ISO-8859-8",
|
||||
"iso_8859-8:1988": "ISO-8859-8",
|
||||
visual: "ISO-8859-8",
|
||||
csisolatin6: "ISO-8859-10",
|
||||
"iso-8859-10": "ISO-8859-10",
|
||||
"iso-ir-157": "ISO-8859-10",
|
||||
"iso8859-10": "ISO-8859-10",
|
||||
iso885910: "ISO-8859-10",
|
||||
l6: "ISO-8859-10",
|
||||
latin6: "ISO-8859-10",
|
||||
"iso-8859-13": "ISO-8859-13",
|
||||
"iso8859-13": "ISO-8859-13",
|
||||
iso885913: "ISO-8859-13",
|
||||
"iso-8859-14": "ISO-8859-14",
|
||||
"iso8859-14": "ISO-8859-14",
|
||||
iso885914: "ISO-8859-14",
|
||||
csisolatin9: "ISO-8859-15",
|
||||
"iso-8859-15": "ISO-8859-15",
|
||||
"iso8859-15": "ISO-8859-15",
|
||||
iso885915: "ISO-8859-15",
|
||||
"iso_8859-15": "ISO-8859-15",
|
||||
l9: "ISO-8859-15",
|
||||
"iso-8859-16": "ISO-8859-16",
|
||||
cskoi8r: "KOI8-R",
|
||||
koi: "KOI8-R",
|
||||
koi8: "KOI8-R",
|
||||
"koi8-r": "KOI8-R",
|
||||
koi8_r: "KOI8-R",
|
||||
"koi8-ru": "KOI8-U",
|
||||
"koi8-u": "KOI8-U",
|
||||
csmacintosh: "macintosh",
|
||||
mac: "macintosh",
|
||||
macintosh: "macintosh",
|
||||
"x-mac-roman": "macintosh",
|
||||
"dos-874": "windows-874",
|
||||
"iso-8859-11": "windows-874",
|
||||
"iso8859-11": "windows-874",
|
||||
iso885911: "windows-874",
|
||||
"tis-620": "windows-874",
|
||||
"windows-874": "windows-874",
|
||||
cp1250: "windows-1250",
|
||||
"windows-1250": "windows-1250",
|
||||
"x-cp1250": "windows-1250",
|
||||
cp1251: "windows-1251",
|
||||
"windows-1251": "windows-1251",
|
||||
"x-cp1251": "windows-1251",
|
||||
"ansi_x3.4-1968": "windows-1252",
|
||||
ascii: "windows-1252",
|
||||
cp1252: "windows-1252",
|
||||
cp819: "windows-1252",
|
||||
csisolatin1: "windows-1252",
|
||||
ibm819: "windows-1252",
|
||||
"iso-8859-1": "windows-1252",
|
||||
"iso-ir-100": "windows-1252",
|
||||
"iso8859-1": "windows-1252",
|
||||
iso88591: "windows-1252",
|
||||
"iso_8859-1": "windows-1252",
|
||||
"iso_8859-1:1987": "windows-1252",
|
||||
l1: "windows-1252",
|
||||
latin1: "windows-1252",
|
||||
"us-ascii": "windows-1252",
|
||||
"windows-1252": "windows-1252",
|
||||
"x-cp1252": "windows-1252",
|
||||
cp1253: "windows-1253",
|
||||
"windows-1253": "windows-1253",
|
||||
"x-cp1253": "windows-1253",
|
||||
cp1254: "windows-1254",
|
||||
csisolatin5: "windows-1254",
|
||||
"iso-8859-9": "windows-1254",
|
||||
"iso-ir-148": "windows-1254",
|
||||
"iso8859-9": "windows-1254",
|
||||
iso88599: "windows-1254",
|
||||
"iso_8859-9": "windows-1254",
|
||||
"iso_8859-9:1989": "windows-1254",
|
||||
l5: "windows-1254",
|
||||
latin5: "windows-1254",
|
||||
"windows-1254": "windows-1254",
|
||||
"x-cp1254": "windows-1254",
|
||||
cp1255: "windows-1255",
|
||||
"windows-1255": "windows-1255",
|
||||
"x-cp1255": "windows-1255",
|
||||
cp1256: "windows-1256",
|
||||
"windows-1256": "windows-1256",
|
||||
"x-cp1256": "windows-1256",
|
||||
cp1257: "windows-1257",
|
||||
"windows-1257": "windows-1257",
|
||||
"x-cp1257": "windows-1257",
|
||||
cp1258: "windows-1258",
|
||||
"windows-1258": "windows-1258",
|
||||
"x-cp1258": "windows-1258",
|
||||
chinese: "GBK",
|
||||
csgb2312: "GBK",
|
||||
csiso58gb231280: "GBK",
|
||||
gb2312: "GBK",
|
||||
gb_2312: "GBK",
|
||||
"gb_2312-80": "GBK",
|
||||
gbk: "GBK",
|
||||
"iso-ir-58": "GBK",
|
||||
"x-gbk": "GBK",
|
||||
gb18030: "gb18030",
|
||||
big5: "Big5",
|
||||
"big5-hkscs": "Big5",
|
||||
"cn-big5": "Big5",
|
||||
csbig5: "Big5",
|
||||
"x-x-big5": "Big5",
|
||||
cseucpkdfmtjapanese: "EUC-JP",
|
||||
"euc-jp": "EUC-JP",
|
||||
"x-euc-jp": "EUC-JP",
|
||||
csshiftjis: "Shift_JIS",
|
||||
ms932: "Shift_JIS",
|
||||
ms_kanji: "Shift_JIS",
|
||||
"shift-jis": "Shift_JIS",
|
||||
shift_jis: "Shift_JIS",
|
||||
sjis: "Shift_JIS",
|
||||
"windows-31j": "Shift_JIS",
|
||||
"x-sjis": "Shift_JIS",
|
||||
cseuckr: "EUC-KR",
|
||||
csksc56011987: "EUC-KR",
|
||||
"euc-kr": "EUC-KR",
|
||||
"iso-ir-149": "EUC-KR",
|
||||
korean: "EUC-KR",
|
||||
"ks_c_5601-1987": "EUC-KR",
|
||||
"ks_c_5601-1989": "EUC-KR",
|
||||
ksc5601: "EUC-KR",
|
||||
ksc_5601: "EUC-KR",
|
||||
"windows-949": "EUC-KR",
|
||||
"utf-16be": "UTF-16BE",
|
||||
"utf-16": "UTF-16LE",
|
||||
"utf-16le": "UTF-16LE"
|
||||
};
|
||||
var _default = exports.default = labelToNames;
|
||||
10
my-app/node_modules/source-map-loader/dist/options.json
generated
vendored
Executable file
10
my-app/node_modules/source-map-loader/dist/options.json
generated
vendored
Executable file
|
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
"title": "Source Map Loader options",
|
||||
"type": "object",
|
||||
"additionalProperties": false,
|
||||
"properties": {
|
||||
"filterSourceMappingUrl": {
|
||||
"instanceof": "Function"
|
||||
}
|
||||
}
|
||||
}
|
||||
300
my-app/node_modules/source-map-loader/dist/parse-data-url.js
generated
vendored
Executable file
300
my-app/node_modules/source-map-loader/dist/parse-data-url.js
generated
vendored
Executable file
|
|
@ -0,0 +1,300 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.default = parseDataUrl;
|
||||
const removeLeadingAndTrailingHTTPWhitespace = string => string.replace(/^[ \t\n\r]+/, "").replace(/[ \t\n\r]+$/, "");
|
||||
const removeTrailingHTTPWhitespace = string => string.replace(/[ \t\n\r]+$/, "");
|
||||
const isHTTPWhitespaceChar = char => char === " " || char === "\t" || char === "\n" || char === "\r";
|
||||
const solelyContainsHTTPTokenCodePoints = string => /^[-!#$%&'*+.^_`|~A-Za-z0-9]*$/.test(string);
|
||||
const soleyContainsHTTPQuotedStringTokenCodePoints = string => /^[\t\u0020-\u007E\u0080-\u00FF]*$/.test(string);
|
||||
const asciiLowercase = string => string.replace(/[A-Z]/g, l => l.toLowerCase());
|
||||
const collectAnHTTPQuotedString = (input, position) => {
|
||||
let value = "";
|
||||
|
||||
// eslint-disable-next-line no-param-reassign
|
||||
position += 1;
|
||||
|
||||
// eslint-disable-next-line no-constant-condition
|
||||
while (true) {
|
||||
while (position < input.length && input[position] !== '"' && input[position] !== "\\") {
|
||||
value += input[position];
|
||||
// eslint-disable-next-line no-param-reassign
|
||||
position += 1;
|
||||
}
|
||||
if (position >= input.length) {
|
||||
break;
|
||||
}
|
||||
const quoteOrBackslash = input[position];
|
||||
|
||||
// eslint-disable-next-line no-param-reassign
|
||||
position += 1;
|
||||
if (quoteOrBackslash === "\\") {
|
||||
if (position >= input.length) {
|
||||
value += "\\";
|
||||
break;
|
||||
}
|
||||
value += input[position];
|
||||
// eslint-disable-next-line no-param-reassign
|
||||
position += 1;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
return [value, position];
|
||||
};
|
||||
function isASCIIHex(c) {
|
||||
return c >= 0x30 && c <= 0x39 || c >= 0x41 && c <= 0x46 || c >= 0x61 && c <= 0x66;
|
||||
}
|
||||
function percentDecodeBytes(input) {
|
||||
const output = new Uint8Array(input.byteLength);
|
||||
let outputIndex = 0;
|
||||
for (let i = 0; i < input.byteLength; ++i) {
|
||||
const byte = input[i];
|
||||
if (byte !== 0x25) {
|
||||
output[outputIndex] = byte;
|
||||
} else if (byte === 0x25 && (!isASCIIHex(input[i + 1]) || !isASCIIHex(input[i + 2]))) {
|
||||
output[outputIndex] = byte;
|
||||
} else {
|
||||
output[outputIndex] = parseInt(String.fromCodePoint(input[i + 1], input[i + 2]), 16);
|
||||
i += 2;
|
||||
}
|
||||
outputIndex += 1;
|
||||
}
|
||||
return output.slice(0, outputIndex);
|
||||
}
|
||||
|
||||
/**
|
||||
* A lookup table for atob(), which converts an ASCII character to the
|
||||
* corresponding six-bit number.
|
||||
*/
|
||||
|
||||
const characters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
||||
function atobLookup(chr) {
|
||||
const index = characters.indexOf(chr);
|
||||
// Throw exception if character is not in the lookup string; should not be hit in tests
|
||||
// eslint-disable-next-line no-undefined
|
||||
return index < 0 ? undefined : index;
|
||||
}
|
||||
|
||||
/**
|
||||
* Implementation of atob() according to the HTML and Infra specs, except that
|
||||
* instead of throwing INVALID_CHARACTER_ERR we return null.
|
||||
*/
|
||||
function atob(input) {
|
||||
/* eslint-disable no-bitwise */
|
||||
// Web IDL requires DOMStrings to just be converted using ECMAScript
|
||||
// ToString, which in our case amounts to using a template literal.
|
||||
let data = `${input}`;
|
||||
|
||||
// "Remove all ASCII whitespace from data."
|
||||
data = data.replace(/[ \t\n\f\r]/g, "");
|
||||
|
||||
// "If data's length divides by 4 leaving no remainder, then: if data ends
|
||||
// with one or two U+003D (=) code points, then remove them from data."
|
||||
if (data.length % 4 === 0) {
|
||||
data = data.replace(/==?$/, "");
|
||||
}
|
||||
|
||||
// "If data's length divides by 4 leaving a remainder of 1, then return
|
||||
// failure."
|
||||
//
|
||||
// "If data contains a code point that is not one of
|
||||
//
|
||||
// U+002B (+)
|
||||
// U+002F (/)
|
||||
// ASCII alphanumeric
|
||||
//
|
||||
// then return failure."
|
||||
if (data.length % 4 === 1 || /[^+/0-9A-Za-z]/.test(data)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// "Let output be an empty byte sequence."
|
||||
let output = "";
|
||||
|
||||
// "Let buffer be an empty buffer that can have bits appended to it."
|
||||
//
|
||||
// We append bits via left-shift and or. accumulatedBits is used to track
|
||||
// when we've gotten to 24 bits.
|
||||
let buffer = 0;
|
||||
let accumulatedBits = 0;
|
||||
|
||||
// "Let position be a position variable for data, initially pointing at the
|
||||
// start of data."
|
||||
//
|
||||
// "While position does not point past the end of data:"
|
||||
for (let i = 0; i < data.length; i++) {
|
||||
// "Find the code point pointed to by position in the second column of
|
||||
// Table 1: The Base 64 Alphabet of RFC 4648. Let n be the number given in
|
||||
// the first cell of the same row.
|
||||
//
|
||||
// "Append to buffer the six bits corresponding to n, most significant bit
|
||||
// first."
|
||||
//
|
||||
// atobLookup() implements the table from RFC 4648.
|
||||
// eslint-disable-next-line no-bitwise
|
||||
buffer <<= 6;
|
||||
|
||||
// eslint-disable-next-line no-bitwise
|
||||
buffer |= atobLookup(data[i]);
|
||||
accumulatedBits += 6;
|
||||
|
||||
// "If buffer has accumulated 24 bits, interpret them as three 8-bit
|
||||
// big-endian numbers. Append three bytes with values equal to those
|
||||
// numbers to output, in the same order, and then empty buffer."
|
||||
if (accumulatedBits === 24) {
|
||||
output += String.fromCharCode((buffer & 0xff0000) >> 16);
|
||||
output += String.fromCharCode((buffer & 0xff00) >> 8);
|
||||
output += String.fromCharCode(buffer & 0xff);
|
||||
accumulatedBits = 0;
|
||||
buffer = 0;
|
||||
}
|
||||
// "Advance position by 1."
|
||||
}
|
||||
|
||||
// "If buffer is not empty, it contains either 12 or 18 bits. If it contains
|
||||
// 12 bits, then discard the last four and interpret the remaining eight as
|
||||
// an 8-bit big-endian number. If it contains 18 bits, then discard the last
|
||||
// two and interpret the remaining 16 as two 8-bit big-endian numbers. Append
|
||||
// the one or two bytes with values equal to those one or two numbers to
|
||||
// output, in the same order."
|
||||
if (accumulatedBits === 12) {
|
||||
buffer >>= 4;
|
||||
output += String.fromCharCode(buffer);
|
||||
} else if (accumulatedBits === 18) {
|
||||
buffer >>= 2;
|
||||
output += String.fromCharCode((buffer & 0xff00) >> 8);
|
||||
output += String.fromCharCode(buffer & 0xff);
|
||||
}
|
||||
/* eslint-enable no-bitwise */
|
||||
|
||||
// "Return output."
|
||||
return output;
|
||||
}
|
||||
function parseDataUrl(stringInput) {
|
||||
let parsedUrl;
|
||||
try {
|
||||
parsedUrl = new URL(stringInput);
|
||||
} catch (error) {
|
||||
return null;
|
||||
}
|
||||
if (parsedUrl.protocol !== "data:") {
|
||||
return null;
|
||||
}
|
||||
parsedUrl.hash = "";
|
||||
|
||||
// `5` is value of `'data:'.length`
|
||||
const input = parsedUrl.toString().substring(5);
|
||||
let position = 0;
|
||||
let mediaType = "";
|
||||
while (position < input.length && input[position] !== ",") {
|
||||
mediaType += input[position];
|
||||
position += 1;
|
||||
}
|
||||
mediaType = mediaType.replace(/^[ \t\n\f\r]+/, "").replace(/[ \t\n\f\r]+$/, "");
|
||||
if (position === input.length) {
|
||||
return null;
|
||||
}
|
||||
position += 1;
|
||||
const encodedBody = input.substring(position);
|
||||
let body = Buffer.from(percentDecodeBytes(Buffer.from(encodedBody, "utf-8")));
|
||||
|
||||
// Can't use /i regexp flag because it isn't restricted to ASCII.
|
||||
const mimeTypeBase64MatchResult = /(.*); *[Bb][Aa][Ss][Ee]64$/.exec(mediaType);
|
||||
if (mimeTypeBase64MatchResult) {
|
||||
const stringBody = body.toString("binary");
|
||||
const asString = atob(stringBody);
|
||||
if (asString === null) {
|
||||
return null;
|
||||
}
|
||||
body = Buffer.from(asString, "binary");
|
||||
[, mediaType] = mimeTypeBase64MatchResult;
|
||||
}
|
||||
if (mediaType.startsWith(";")) {
|
||||
mediaType = `text/plain ${mediaType}`;
|
||||
}
|
||||
const result = {
|
||||
// eslint-disable-next-line no-undefined
|
||||
type: undefined,
|
||||
// eslint-disable-next-line no-undefined
|
||||
subtype: undefined,
|
||||
parameters: new Map(),
|
||||
isBase64: Boolean(mimeTypeBase64MatchResult),
|
||||
body
|
||||
};
|
||||
if (!mediaType) {
|
||||
return result;
|
||||
}
|
||||
const inputMediaType = removeLeadingAndTrailingHTTPWhitespace(mediaType);
|
||||
let positionMediaType = 0;
|
||||
let type = "";
|
||||
while (positionMediaType < inputMediaType.length && inputMediaType[positionMediaType] !== "/") {
|
||||
type += inputMediaType[positionMediaType];
|
||||
positionMediaType += 1;
|
||||
}
|
||||
if (type.length === 0 || !solelyContainsHTTPTokenCodePoints(type)) {
|
||||
return result;
|
||||
}
|
||||
if (positionMediaType >= inputMediaType.length) {
|
||||
return result;
|
||||
}
|
||||
|
||||
// Skips past "/"
|
||||
positionMediaType += 1;
|
||||
let subtype = "";
|
||||
while (positionMediaType < inputMediaType.length && inputMediaType[positionMediaType] !== ";") {
|
||||
subtype += inputMediaType[positionMediaType];
|
||||
positionMediaType += 1;
|
||||
}
|
||||
subtype = removeTrailingHTTPWhitespace(subtype);
|
||||
if (subtype.length === 0 || !solelyContainsHTTPTokenCodePoints(subtype)) {
|
||||
return result;
|
||||
}
|
||||
result.type = asciiLowercase(type);
|
||||
result.subtype = asciiLowercase(subtype);
|
||||
while (positionMediaType < inputMediaType.length) {
|
||||
// Skip past ";"
|
||||
positionMediaType += 1;
|
||||
while (isHTTPWhitespaceChar(inputMediaType[positionMediaType])) {
|
||||
positionMediaType += 1;
|
||||
}
|
||||
let parameterName = "";
|
||||
while (positionMediaType < inputMediaType.length && inputMediaType[positionMediaType] !== ";" && inputMediaType[positionMediaType] !== "=") {
|
||||
parameterName += inputMediaType[positionMediaType];
|
||||
positionMediaType += 1;
|
||||
}
|
||||
parameterName = asciiLowercase(parameterName);
|
||||
if (positionMediaType < inputMediaType.length) {
|
||||
if (inputMediaType[positionMediaType] === ";") {
|
||||
// eslint-disable-next-line no-continue
|
||||
continue;
|
||||
}
|
||||
|
||||
// Skip past "="
|
||||
positionMediaType += 1;
|
||||
}
|
||||
let parameterValue = "";
|
||||
if (inputMediaType[positionMediaType] === '"') {
|
||||
[parameterValue, positionMediaType] = collectAnHTTPQuotedString(inputMediaType, positionMediaType);
|
||||
while (positionMediaType < inputMediaType.length && inputMediaType[positionMediaType] !== ";") {
|
||||
positionMediaType += 1;
|
||||
}
|
||||
} else {
|
||||
while (positionMediaType < inputMediaType.length && inputMediaType[positionMediaType] !== ";") {
|
||||
parameterValue += inputMediaType[positionMediaType];
|
||||
positionMediaType += 1;
|
||||
}
|
||||
parameterValue = removeTrailingHTTPWhitespace(parameterValue);
|
||||
if (parameterValue === "") {
|
||||
// eslint-disable-next-line no-continue
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if (parameterName.length > 0 && solelyContainsHTTPTokenCodePoints(parameterName) && soleyContainsHTTPQuotedStringTokenCodePoints(parameterValue) && !result.parameters.has(parameterName)) {
|
||||
result.parameters.set(parameterName, parameterValue);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
215
my-app/node_modules/source-map-loader/dist/utils.js
generated
vendored
Executable file
215
my-app/node_modules/source-map-loader/dist/utils.js
generated
vendored
Executable file
|
|
@ -0,0 +1,215 @@
|
|||
"use strict";
|
||||
|
||||
Object.defineProperty(exports, "__esModule", {
|
||||
value: true
|
||||
});
|
||||
exports.fetchFromURL = fetchFromURL;
|
||||
exports.flattenSourceMap = flattenSourceMap;
|
||||
exports.getSourceMappingURL = getSourceMappingURL;
|
||||
exports.isURL = isURL;
|
||||
var _path = _interopRequireDefault(require("path"));
|
||||
var _url = _interopRequireDefault(require("url"));
|
||||
var _sourceMapJs = _interopRequireDefault(require("source-map-js"));
|
||||
var _iconvLite = require("iconv-lite");
|
||||
var _parseDataUrl = _interopRequireDefault(require("./parse-data-url"));
|
||||
var _labelsToNames = _interopRequireDefault(require("./labels-to-names"));
|
||||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
||||
// Matches only the last occurrence of sourceMappingURL
|
||||
const innerRegex = /\s*[#@]\s*sourceMappingURL\s*=\s*([^\s'"]*)\s*/;
|
||||
|
||||
/* eslint-disable prefer-template */
|
||||
const sourceMappingURLRegex = RegExp("(?:" + "/\\*" + "(?:\\s*\r?\n(?://)?)?" + "(?:" + innerRegex.source + ")" + "\\s*" + "\\*/" + "|" + "//(?:" + innerRegex.source + ")" + ")" + "\\s*");
|
||||
/* eslint-enable prefer-template */
|
||||
|
||||
function labelToName(label) {
|
||||
const labelLowercase = String(label).trim().toLowerCase();
|
||||
return _labelsToNames.default[labelLowercase] || null;
|
||||
}
|
||||
async function flattenSourceMap(map) {
|
||||
const consumer = await new _sourceMapJs.default.SourceMapConsumer(map);
|
||||
const generatedMap = map.file ? new _sourceMapJs.default.SourceMapGenerator({
|
||||
file: map.file
|
||||
}) : new _sourceMapJs.default.SourceMapGenerator();
|
||||
consumer.sources.forEach(sourceFile => {
|
||||
const sourceContent = consumer.sourceContentFor(sourceFile, true);
|
||||
generatedMap.setSourceContent(sourceFile, sourceContent);
|
||||
});
|
||||
consumer.eachMapping(mapping => {
|
||||
const {
|
||||
source
|
||||
} = consumer.originalPositionFor({
|
||||
line: mapping.generatedLine,
|
||||
column: mapping.generatedColumn
|
||||
});
|
||||
const mappings = {
|
||||
source,
|
||||
original: {
|
||||
line: mapping.originalLine,
|
||||
column: mapping.originalColumn
|
||||
},
|
||||
generated: {
|
||||
line: mapping.generatedLine,
|
||||
column: mapping.generatedColumn
|
||||
}
|
||||
};
|
||||
if (source) {
|
||||
generatedMap.addMapping(mappings);
|
||||
}
|
||||
});
|
||||
return generatedMap.toJSON();
|
||||
}
|
||||
function getSourceMappingURL(code) {
|
||||
const lines = code.split(/^/m);
|
||||
let match;
|
||||
for (let i = lines.length - 1; i >= 0; i--) {
|
||||
match = lines[i].match(sourceMappingURLRegex);
|
||||
if (match) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
const sourceMappingURL = match ? match[1] || match[2] || "" : null;
|
||||
return {
|
||||
sourceMappingURL: sourceMappingURL ? decodeURI(sourceMappingURL) : sourceMappingURL,
|
||||
replacementString: match ? match[0] : null
|
||||
};
|
||||
}
|
||||
function getAbsolutePath(context, request, sourceRoot) {
|
||||
if (isURL(sourceRoot)) {
|
||||
return new URL(request, sourceRoot).toString();
|
||||
}
|
||||
if (sourceRoot) {
|
||||
if (_path.default.isAbsolute(sourceRoot)) {
|
||||
return _path.default.join(sourceRoot, request);
|
||||
}
|
||||
return _path.default.join(context, sourceRoot, request);
|
||||
}
|
||||
return _path.default.join(context, request);
|
||||
}
|
||||
function fetchFromDataURL(loaderContext, sourceURL) {
|
||||
const dataURL = (0, _parseDataUrl.default)(sourceURL);
|
||||
if (dataURL) {
|
||||
// https://tools.ietf.org/html/rfc4627
|
||||
// JSON text SHALL be encoded in Unicode. The default encoding is UTF-8.
|
||||
const encodingName = labelToName(dataURL.parameters.get("charset")) || "UTF-8";
|
||||
return (0, _iconvLite.decode)(dataURL.body, encodingName);
|
||||
}
|
||||
throw new Error(`Failed to parse source map from "data" URL: ${sourceURL}`);
|
||||
}
|
||||
async function fetchFromFilesystem(loaderContext, sourceURL) {
|
||||
let buffer;
|
||||
if (isURL(sourceURL)) {
|
||||
return {
|
||||
path: sourceURL
|
||||
};
|
||||
}
|
||||
try {
|
||||
buffer = await new Promise((resolve, reject) => {
|
||||
loaderContext.fs.readFile(sourceURL, (error, data) => {
|
||||
if (error) {
|
||||
return reject(error);
|
||||
}
|
||||
return resolve(data);
|
||||
});
|
||||
});
|
||||
} catch (error) {
|
||||
throw new Error(`Failed to parse source map from '${sourceURL}' file: ${error}`);
|
||||
}
|
||||
return {
|
||||
path: sourceURL,
|
||||
data: buffer.toString()
|
||||
};
|
||||
}
|
||||
async function fetchPathsFromFilesystem(loaderContext, possibleRequests, errorsAccumulator = "") {
|
||||
let result;
|
||||
try {
|
||||
result = await fetchFromFilesystem(loaderContext, possibleRequests[0], errorsAccumulator);
|
||||
} catch (error) {
|
||||
// eslint-disable-next-line no-param-reassign
|
||||
errorsAccumulator += `${error.message}\n\n`;
|
||||
const [, ...tailPossibleRequests] = possibleRequests;
|
||||
if (tailPossibleRequests.length === 0) {
|
||||
error.message = errorsAccumulator;
|
||||
throw error;
|
||||
}
|
||||
return fetchPathsFromFilesystem(loaderContext, tailPossibleRequests, errorsAccumulator);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
function isURL(value) {
|
||||
return /^[a-z][a-z0-9+.-]*:/i.test(value) && !_path.default.win32.isAbsolute(value);
|
||||
}
|
||||
async function fetchFromURL(loaderContext, context, url, sourceRoot, skipReading = false) {
|
||||
// 1. It's an absolute url and it is not `windows` path like `C:\dir\file`
|
||||
if (isURL(url)) {
|
||||
const {
|
||||
protocol
|
||||
} = _url.default.parse(url);
|
||||
if (protocol === "data:") {
|
||||
if (skipReading) {
|
||||
return {
|
||||
sourceURL: ""
|
||||
};
|
||||
}
|
||||
const sourceContent = fetchFromDataURL(loaderContext, url);
|
||||
return {
|
||||
sourceURL: "",
|
||||
sourceContent
|
||||
};
|
||||
}
|
||||
if (skipReading) {
|
||||
return {
|
||||
sourceURL: url
|
||||
};
|
||||
}
|
||||
if (protocol === "file:") {
|
||||
const pathFromURL = _url.default.fileURLToPath(url);
|
||||
const sourceURL = _path.default.normalize(pathFromURL);
|
||||
const {
|
||||
data: sourceContent
|
||||
} = await fetchFromFilesystem(loaderContext, sourceURL);
|
||||
return {
|
||||
sourceURL,
|
||||
sourceContent
|
||||
};
|
||||
}
|
||||
throw new Error(`Failed to parse source map: '${url}' URL is not supported`);
|
||||
}
|
||||
|
||||
// 2. It's a scheme-relative
|
||||
if (/^\/\//.test(url)) {
|
||||
throw new Error(`Failed to parse source map: '${url}' URL is not supported`);
|
||||
}
|
||||
|
||||
// 3. Absolute path
|
||||
if (_path.default.isAbsolute(url)) {
|
||||
let sourceURL = _path.default.normalize(url);
|
||||
let sourceContent;
|
||||
if (!skipReading) {
|
||||
const possibleRequests = [sourceURL];
|
||||
if (url.startsWith("/")) {
|
||||
possibleRequests.push(getAbsolutePath(context, sourceURL.slice(1), sourceRoot));
|
||||
}
|
||||
const result = await fetchPathsFromFilesystem(loaderContext, possibleRequests);
|
||||
sourceURL = result.path;
|
||||
sourceContent = result.data;
|
||||
}
|
||||
return {
|
||||
sourceURL,
|
||||
sourceContent
|
||||
};
|
||||
}
|
||||
|
||||
// 4. Relative path
|
||||
const sourceURL = getAbsolutePath(context, url, sourceRoot);
|
||||
let sourceContent;
|
||||
if (!skipReading) {
|
||||
const {
|
||||
data
|
||||
} = await fetchFromFilesystem(loaderContext, sourceURL);
|
||||
sourceContent = data;
|
||||
}
|
||||
return {
|
||||
sourceURL,
|
||||
sourceContent
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue