@parcel/utils 2.0.0-nightly.1380 → 2.0.0-nightly.1385

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 CHANGED
@@ -3475,7 +3475,6 @@ $parcel$export(module.exports, "matchSourceMappingURL", () => $58ae611e06043814$
3475
3475
  $parcel$export(module.exports, "loadSourceMapUrl", () => $58ae611e06043814$export$527a92fa675f5e93);
3476
3476
  $parcel$export(module.exports, "loadSourceMap", () => $58ae611e06043814$export$c500fecaca54de65);
3477
3477
  $parcel$export(module.exports, "remapSourceLocation", () => $58ae611e06043814$export$2fed780245c466c1);
3478
- $parcel$export(module.exports, "BitSet", () => $0f54b57eb7ece508$export$33dc8f3f7b9e35df);
3479
3478
  $parcel$export(module.exports, "stripAnsi", () => (/*@__PURE__*/$parcel$interopDefault($166044cf9ce846b7$exports)));
3480
3479
  function $e7d0753bf78fdf0d$export$2e2bcd8739ae039(string, startIndex = 0) {
3481
3480
  let lines = 1;
@@ -34625,17 +34624,20 @@ $f2eb8388071f2c88$var$validateSchema.diagnostic = function(schema, data, origin,
34625
34624
  map = (_data_source = data.source) !== null && _data_source !== void 0 ? _data_source : JSON.stringify((0, (/*@__PURE__*/$parcel$interopDefault($3fb15c2a4d9dd820$exports)))(data.data), 0, " ");
34626
34625
  code = map;
34627
34626
  }
34628
- var _data_filePath, _data_prependKey;
34627
+ var _data_filePath;
34629
34628
  let codeFrames = [
34630
34629
  {
34631
34630
  filePath: (_data_filePath = data.filePath) !== null && _data_filePath !== void 0 ? _data_filePath : undefined,
34632
34631
  language: "json",
34633
34632
  code: code,
34634
- codeHighlights: (0, $eJUMF$parceldiagnostic.generateJSONCodeHighlights)(map, keys.map(({ key: key, type: type, message: message })=>({
34633
+ codeHighlights: (0, $eJUMF$parceldiagnostic.generateJSONCodeHighlights)(map, keys.map(({ key: key, type: type, message: message })=>{
34634
+ var _data_prependKey;
34635
+ return {
34635
34636
  key: ((_data_prependKey = data.prependKey) !== null && _data_prependKey !== void 0 ? _data_prependKey : "") + key,
34636
34637
  type: type,
34637
34638
  message: message != null ? (0, $eJUMF$parceldiagnostic.escapeMarkdown)(message) : message
34638
- })))
34639
+ };
34640
+ }))
34639
34641
  }
34640
34642
  ];
34641
34643
  throw new (0, ($parcel$interopDefault($eJUMF$parceldiagnostic)))({
@@ -36710,9 +36712,8 @@ function $1b5cf2552daa3eaf$export$d175e66e9fcd7b75(fs, filepath, filenames, proj
36710
36712
  return fs.findAncestorFile(filenames, (0, ($parcel$interopDefault($eJUMF$path))).dirname(filepath), projectRoot);
36711
36713
  }
36712
36714
  async function $1b5cf2552daa3eaf$export$c1a4367d4847eb06(fs, filepath, filenames, projectRoot, opts) {
36713
- var _opts;
36714
36715
  var _opts_parse;
36715
- let parse = (_opts_parse = (_opts = opts) === null || _opts === void 0 ? void 0 : _opts.parse) !== null && _opts_parse !== void 0 ? _opts_parse : true;
36716
+ let parse = (_opts_parse = opts === null || opts === void 0 ? void 0 : opts.parse) !== null && _opts_parse !== void 0 ? _opts_parse : true;
36716
36717
  let configFile = await $1b5cf2552daa3eaf$export$7eca4ea16d4c8343(fs, filepath, filenames, projectRoot);
36717
36718
  if (configFile) {
36718
36719
  let cachedOutput = $1b5cf2552daa3eaf$var$configCache.get(String(parse) + configFile);
@@ -36745,9 +36746,8 @@ $1b5cf2552daa3eaf$export$c1a4367d4847eb06.clear = ()=>{
36745
36746
  $1b5cf2552daa3eaf$var$resolveCache.clear();
36746
36747
  };
36747
36748
  async function $1b5cf2552daa3eaf$export$f5327b421858c8cd(fs, configFile, opts) {
36748
- var _opts;
36749
36749
  var _opts_parse;
36750
- let parse = (_opts_parse = (_opts = opts) === null || _opts === void 0 ? void 0 : _opts.parse) !== null && _opts_parse !== void 0 ? _opts_parse : true;
36750
+ let parse = (_opts_parse = opts === null || opts === void 0 ? void 0 : opts.parse) !== null && _opts_parse !== void 0 ? _opts_parse : true;
36751
36751
  let cachedOutput = $1b5cf2552daa3eaf$var$configCache.get(String(parse) + configFile);
36752
36752
  if (cachedOutput) return cachedOutput;
36753
36753
  try {
@@ -36755,10 +36755,9 @@ async function $1b5cf2552daa3eaf$export$f5327b421858c8cd(fs, configFile, opts) {
36755
36755
  let config;
36756
36756
  if (parse === false) config = configContent;
36757
36757
  else {
36758
- var _opts1;
36759
36758
  let extname = (0, ($parcel$interopDefault($eJUMF$path))).extname(configFile).slice(1);
36760
36759
  var _opts_parser;
36761
- let parse = (_opts_parser = (_opts1 = opts) === null || _opts1 === void 0 ? void 0 : _opts1.parser) !== null && _opts_parser !== void 0 ? _opts_parser : $1b5cf2552daa3eaf$var$getParser(extname);
36760
+ let parse = (_opts_parser = opts === null || opts === void 0 ? void 0 : opts.parser) !== null && _opts_parser !== void 0 ? _opts_parser : $1b5cf2552daa3eaf$var$getParser(extname);
36762
36761
  try {
36763
36762
  config = parse(configContent);
36764
36763
  } catch (e) {
@@ -37143,9 +37142,8 @@ async function $da0b7647e94c7f83$export$f074a8f9bef628fd({ bundle: bundle, bundl
37143
37142
  if (node.type === "dependency") dependencies.push(node.value);
37144
37143
  });
37145
37144
  for (let dependency of dependencies){
37146
- var _entryBundle;
37147
37145
  let entryBundle = bundleGraph.getReferencedBundle(dependency, bundle);
37148
- if (((_entryBundle = entryBundle) === null || _entryBundle === void 0 ? void 0 : _entryBundle.bundleBehavior) !== "inline") continue;
37146
+ if ((entryBundle === null || entryBundle === void 0 ? void 0 : entryBundle.bundleBehavior) !== "inline") continue;
37149
37147
  let packagedBundle = await getInlineBundleContents(entryBundle, bundleGraph);
37150
37148
  let packagedContents = (packagedBundle.contents instanceof (0, $eJUMF$stream.Readable) ? await (0, $94281e95849778d7$export$f109d1c79a5ae5a1)(packagedBundle.contents) : packagedBundle.contents).toString();
37151
37149
  let inlineType = (0, (/*@__PURE__*/$parcel$interopDefault($3fb15c2a4d9dd820$exports)))(entryBundle.getMainEntry()).meta.inlineType;
@@ -37502,18 +37500,17 @@ async function $58ae611e06043814$export$c500fecaca54de65(filename, contents, opt
37502
37500
  }
37503
37501
  }
37504
37502
  function $58ae611e06043814$export$2fed780245c466c1(loc, originalMap) {
37505
- var _start, _end;
37506
37503
  let { filePath: filePath, start: { line: startLine, column: startCol }, end: { line: endLine, column: endCol } } = loc;
37507
37504
  let lineDiff = endLine - startLine;
37508
37505
  let colDiff = endCol - startCol;
37509
37506
  let start = originalMap.findClosestMapping(startLine, startCol - 1);
37510
37507
  let end = originalMap.findClosestMapping(endLine, endCol - 1);
37511
- if ((_start = start) === null || _start === void 0 ? void 0 : _start.original) {
37508
+ if (start === null || start === void 0 ? void 0 : start.original) {
37512
37509
  if (start.source) filePath = start.source;
37513
37510
  ({ line: startLine, column: startCol } = start.original);
37514
37511
  startCol++; // source map columns are 0-based
37515
37512
  }
37516
- if ((_end = end) === null || _end === void 0 ? void 0 : _end.original) {
37513
+ if (end === null || end === void 0 ? void 0 : end.original) {
37517
37514
  ({ line: endLine, column: endCol } = end.original);
37518
37515
  endCol++; // source map columns are 0-based
37519
37516
  if (endLine < startLine) {
@@ -37540,97 +37537,6 @@ function $58ae611e06043814$export$2fed780245c466c1(loc, originalMap) {
37540
37537
  }
37541
37538
 
37542
37539
 
37543
-
37544
- // As our current version of flow doesn't support BigInt's, these values/types
37545
- // have been hoisted to keep the flow errors to a minimum. This can be removed
37546
- // if we upgrade to a flow version that supports BigInt's
37547
- // $FlowFixMe
37548
- // $FlowFixMe
37549
- const $0f54b57eb7ece508$var$BIGINT_ZERO = 0n;
37550
- // $FlowFixMe
37551
- const $0f54b57eb7ece508$var$BIGINT_ONE = 1n;
37552
- // $FlowFixMe
37553
- let $0f54b57eb7ece508$var$numberToBigInt = (v)=>BigInt(v);
37554
- let $0f54b57eb7ece508$var$bitUnion = (a, b)=>a | b;
37555
- class $0f54b57eb7ece508$export$33dc8f3f7b9e35df {
37556
- constructor({ initial: initial, items: items, lookup: lookup }){
37557
- var _initial;
37558
- if (initial instanceof $0f54b57eb7ece508$export$33dc8f3f7b9e35df) this._value = (_initial = initial) === null || _initial === void 0 ? void 0 : _initial._value;
37559
- else if (initial) this._value = initial;
37560
- else this._value = $0f54b57eb7ece508$var$BIGINT_ZERO;
37561
- this._items = items;
37562
- this._lookup = lookup;
37563
- }
37564
- static from(items) {
37565
- let lookup = new Map();
37566
- for(let i = 0; i < items.length; i++)lookup.set(items[i], $0f54b57eb7ece508$var$numberToBigInt(i));
37567
- return new $0f54b57eb7ece508$export$33dc8f3f7b9e35df({
37568
- items: items,
37569
- lookup: lookup
37570
- });
37571
- }
37572
- static union(a, b) {
37573
- return new $0f54b57eb7ece508$export$33dc8f3f7b9e35df({
37574
- initial: $0f54b57eb7ece508$var$bitUnion(a._value, b._value),
37575
- lookup: a._lookup,
37576
- items: a._items
37577
- });
37578
- }
37579
- #getIndex(item) {
37580
- return (0, (/*@__PURE__*/$parcel$interopDefault($3fb15c2a4d9dd820$exports)))(this._lookup.get(item), "Item is missing from BitSet");
37581
- }
37582
- add(item) {
37583
- this._value |= $0f54b57eb7ece508$var$BIGINT_ONE << this.#getIndex(item);
37584
- }
37585
- delete(item) {
37586
- this._value &= ~($0f54b57eb7ece508$var$BIGINT_ONE << this.#getIndex(item));
37587
- }
37588
- has(item) {
37589
- return Boolean(this._value & $0f54b57eb7ece508$var$BIGINT_ONE << this.#getIndex(item));
37590
- }
37591
- intersect(v) {
37592
- this._value = this._value & v._value;
37593
- }
37594
- union(v) {
37595
- this._value = $0f54b57eb7ece508$var$bitUnion(this._value, v._value);
37596
- }
37597
- clear() {
37598
- this._value = $0f54b57eb7ece508$var$BIGINT_ZERO;
37599
- }
37600
- cloneEmpty() {
37601
- return new $0f54b57eb7ece508$export$33dc8f3f7b9e35df({
37602
- lookup: this._lookup,
37603
- items: this._items
37604
- });
37605
- }
37606
- clone() {
37607
- return new $0f54b57eb7ece508$export$33dc8f3f7b9e35df({
37608
- lookup: this._lookup,
37609
- items: this._items,
37610
- initial: this._value
37611
- });
37612
- }
37613
- values() {
37614
- let values = [];
37615
- let tmpValue = this._value;
37616
- let i;
37617
- // This implementation is optimized for BitSets that contain a very small percentage
37618
- // of items compared to the total number of potential items. This makes sense for
37619
- // our bundler use-cases where Sets often contain <1% coverage of the total item count.
37620
- // In cases where Sets contain a larger percentage of the total items, a regular looping
37621
- // strategy would be more performant.
37622
- while(tmpValue > $0f54b57eb7ece508$var$BIGINT_ZERO){
37623
- // Get last set bit
37624
- i = tmpValue.toString(2).length - 1;
37625
- values.push(this._items[i]);
37626
- // Unset last set bit
37627
- tmpValue &= ~($0f54b57eb7ece508$var$BIGINT_ONE << $0f54b57eb7ece508$var$numberToBigInt(i));
37628
- }
37629
- return values;
37630
- }
37631
- }
37632
-
37633
-
37634
37540
  var $166044cf9ce846b7$exports = {};
37635
37541
  "use strict";
37636
37542
  var $d1a267d3dbd285eb$exports = {};