@parcel/utils 2.0.0-nightly.1335 → 2.0.0-nightly.1340
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.js +13 -7
- package/lib/index.js.map +1 -1
- package/package.json +7 -7
package/lib/index.js
CHANGED
|
@@ -36710,8 +36710,9 @@ function $10671d0be444e08b$export$d175e66e9fcd7b75(fs, filepath, filenames, proj
|
|
|
36710
36710
|
return fs.findAncestorFile(filenames, (0, ($parcel$interopDefault($8C1kk$path))).dirname(filepath), projectRoot);
|
|
36711
36711
|
}
|
|
36712
36712
|
async function $10671d0be444e08b$export$c1a4367d4847eb06(fs, filepath, filenames, projectRoot, opts) {
|
|
36713
|
+
var _opts;
|
|
36713
36714
|
var _opts_parse;
|
|
36714
|
-
let parse = (_opts_parse = opts === null ||
|
|
36715
|
+
let parse = (_opts_parse = (_opts = opts) === null || _opts === void 0 ? void 0 : _opts.parse) !== null && _opts_parse !== void 0 ? _opts_parse : true;
|
|
36715
36716
|
let configFile = await $10671d0be444e08b$export$7eca4ea16d4c8343(fs, filepath, filenames, projectRoot);
|
|
36716
36717
|
if (configFile) {
|
|
36717
36718
|
let cachedOutput = $10671d0be444e08b$var$configCache.get(String(parse) + configFile);
|
|
@@ -36744,8 +36745,9 @@ $10671d0be444e08b$export$c1a4367d4847eb06.clear = ()=>{
|
|
|
36744
36745
|
$10671d0be444e08b$var$resolveCache.clear();
|
|
36745
36746
|
};
|
|
36746
36747
|
async function $10671d0be444e08b$export$f5327b421858c8cd(fs, configFile, opts) {
|
|
36748
|
+
var _opts;
|
|
36747
36749
|
var _opts_parse;
|
|
36748
|
-
let parse = (_opts_parse = opts === null ||
|
|
36750
|
+
let parse = (_opts_parse = (_opts = opts) === null || _opts === void 0 ? void 0 : _opts.parse) !== null && _opts_parse !== void 0 ? _opts_parse : true;
|
|
36749
36751
|
let cachedOutput = $10671d0be444e08b$var$configCache.get(String(parse) + configFile);
|
|
36750
36752
|
if (cachedOutput) return cachedOutput;
|
|
36751
36753
|
try {
|
|
@@ -36753,9 +36755,10 @@ async function $10671d0be444e08b$export$f5327b421858c8cd(fs, configFile, opts) {
|
|
|
36753
36755
|
let config;
|
|
36754
36756
|
if (parse === false) config = configContent;
|
|
36755
36757
|
else {
|
|
36758
|
+
var _opts1;
|
|
36756
36759
|
let extname = (0, ($parcel$interopDefault($8C1kk$path))).extname(configFile).slice(1);
|
|
36757
36760
|
var _opts_parser;
|
|
36758
|
-
let parse = (_opts_parser = opts === null ||
|
|
36761
|
+
let parse = (_opts_parser = (_opts1 = opts) === null || _opts1 === void 0 ? void 0 : _opts1.parser) !== null && _opts_parser !== void 0 ? _opts_parser : $10671d0be444e08b$var$getParser(extname);
|
|
36759
36762
|
try {
|
|
36760
36763
|
config = parse(configContent);
|
|
36761
36764
|
} catch (e) {
|
|
@@ -37140,8 +37143,9 @@ async function $bc66accb63b05e9a$export$f074a8f9bef628fd({ bundle: bundle, bundl
|
|
|
37140
37143
|
if (node.type === "dependency") dependencies.push(node.value);
|
|
37141
37144
|
});
|
|
37142
37145
|
for (let dependency of dependencies){
|
|
37146
|
+
var _entryBundle;
|
|
37143
37147
|
let entryBundle = bundleGraph.getReferencedBundle(dependency, bundle);
|
|
37144
|
-
if ((entryBundle === null ||
|
|
37148
|
+
if (((_entryBundle = entryBundle) === null || _entryBundle === void 0 ? void 0 : _entryBundle.bundleBehavior) !== "inline") continue;
|
|
37145
37149
|
let packagedBundle = await getInlineBundleContents(entryBundle, bundleGraph);
|
|
37146
37150
|
let packagedContents = (packagedBundle.contents instanceof (0, $8C1kk$stream.Readable) ? await (0, $29bb96d8a6524ff0$export$f109d1c79a5ae5a1)(packagedBundle.contents) : packagedBundle.contents).toString();
|
|
37147
37151
|
let inlineType = (0, (/*@__PURE__*/$parcel$interopDefault($812806c6461f2963$exports)))(entryBundle.getMainEntry()).meta.inlineType;
|
|
@@ -37498,17 +37502,18 @@ async function $46fc74961fdcfe31$export$c500fecaca54de65(filename, contents, opt
|
|
|
37498
37502
|
}
|
|
37499
37503
|
}
|
|
37500
37504
|
function $46fc74961fdcfe31$export$2fed780245c466c1(loc, originalMap) {
|
|
37505
|
+
var _start, _end;
|
|
37501
37506
|
let { filePath: filePath, start: { line: startLine, column: startCol }, end: { line: endLine, column: endCol } } = loc;
|
|
37502
37507
|
let lineDiff = endLine - startLine;
|
|
37503
37508
|
let colDiff = endCol - startCol;
|
|
37504
37509
|
let start = originalMap.findClosestMapping(startLine, startCol - 1);
|
|
37505
37510
|
let end = originalMap.findClosestMapping(endLine, endCol - 1);
|
|
37506
|
-
if (start === null ||
|
|
37511
|
+
if ((_start = start) === null || _start === void 0 ? void 0 : _start.original) {
|
|
37507
37512
|
if (start.source) filePath = start.source;
|
|
37508
37513
|
({ line: startLine, column: startCol } = start.original);
|
|
37509
37514
|
startCol++; // source map columns are 0-based
|
|
37510
37515
|
}
|
|
37511
|
-
if (end === null ||
|
|
37516
|
+
if ((_end = end) === null || _end === void 0 ? void 0 : _end.original) {
|
|
37512
37517
|
({ line: endLine, column: endCol } = end.original);
|
|
37513
37518
|
endCol++; // source map columns are 0-based
|
|
37514
37519
|
if (endLine < startLine) {
|
|
@@ -37549,7 +37554,8 @@ let $2c32463ab90dab73$var$numberToBigInt = (v)=>BigInt(v);
|
|
|
37549
37554
|
let $2c32463ab90dab73$var$bitUnion = (a, b)=>a | b;
|
|
37550
37555
|
class $2c32463ab90dab73$export$33dc8f3f7b9e35df {
|
|
37551
37556
|
constructor({ initial: initial, items: items, lookup: lookup }){
|
|
37552
|
-
|
|
37557
|
+
var _initial;
|
|
37558
|
+
if (initial instanceof $2c32463ab90dab73$export$33dc8f3f7b9e35df) this._value = (_initial = initial) === null || _initial === void 0 ? void 0 : _initial._value;
|
|
37553
37559
|
else if (initial) this._value = initial;
|
|
37554
37560
|
else this._value = $2c32463ab90dab73$var$BIGINT_ZERO;
|
|
37555
37561
|
this._items = items;
|