@parcel/utils 2.8.1 → 2.8.2

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
@@ -33923,8 +33923,8 @@ function $4ca1027d34905147$export$2115c2c0a84eef61(expectedValues, actualValue)
33923
33923
  }
33924
33924
  $4ca1027d34905147$var$validateSchema.diagnostic = function(schema, data, origin, message) {
33925
33925
  if ("source" in data && "data" in data && typeof data.source !== "string" && !data) throw new Error("At least one of data.source and data.data must be defined!");
33926
- var _data;
33927
- let object = data.map ? data.map.data : (_data = data.data) !== null && _data !== void 0 ? _data : JSON.parse(data.source);
33926
+ var _data_data;
33927
+ let object = data.map ? data.map.data : (_data_data = data.data) !== null && _data_data !== void 0 ? _data_data : JSON.parse(data.source);
33928
33928
  let errors = $4ca1027d34905147$var$validateSchema(schema, object);
33929
33929
  if (errors.length) {
33930
33930
  let keys = errors.map((e)=>{
@@ -33964,19 +33964,19 @@ $4ca1027d34905147$var$validateSchema.diagnostic = function(schema, data, origin,
33964
33964
  map = data.map;
33965
33965
  code = data.source;
33966
33966
  } else {
33967
- var _source;
33967
+ var _data_source;
33968
33968
  // $FlowFixMe we can assume that data is valid JSON
33969
- map = (_source = data.source) !== null && _source !== void 0 ? _source : JSON.stringify((0, (/*@__PURE__*/$parcel$interopDefault($812806c6461f2963$exports)))(data.data), 0, " ");
33969
+ map = (_data_source = data.source) !== null && _data_source !== void 0 ? _data_source : JSON.stringify((0, (/*@__PURE__*/$parcel$interopDefault($812806c6461f2963$exports)))(data.data), 0, " ");
33970
33970
  code = map;
33971
33971
  }
33972
- var _filePath, _prependKey;
33972
+ var _data_filePath, _data_prependKey;
33973
33973
  let codeFrames = [
33974
33974
  {
33975
- filePath: (_filePath = data.filePath) !== null && _filePath !== void 0 ? _filePath : undefined,
33975
+ filePath: (_data_filePath = data.filePath) !== null && _data_filePath !== void 0 ? _data_filePath : undefined,
33976
33976
  language: "json",
33977
33977
  code: code,
33978
33978
  codeHighlights: (0, $8C1kk$parceldiagnostic.generateJSONCodeHighlights)(map, keys.map(({ key: key , type: type , message: message })=>({
33979
- key: ((_prependKey = data.prependKey) !== null && _prependKey !== void 0 ? _prependKey : "") + key,
33979
+ key: ((_data_prependKey = data.prependKey) !== null && _data_prependKey !== void 0 ? _data_prependKey : "") + key,
33980
33980
  type: type,
33981
33981
  message: message != null ? (0, $8C1kk$parceldiagnostic.escapeMarkdown)(message) : message
33982
33982
  })))
@@ -34474,7 +34474,7 @@ var $284aeb9e515b63c0$var$clone = function() {
34474
34474
  clone.__getRegExpFlags = __getRegExpFlags;
34475
34475
  return clone;
34476
34476
  }();
34477
- if ($284aeb9e515b63c0$exports) $284aeb9e515b63c0$exports = $284aeb9e515b63c0$var$clone;
34477
+ if (0, $284aeb9e515b63c0$exports) $284aeb9e515b63c0$exports = $284aeb9e515b63c0$var$clone;
34478
34478
 
34479
34479
 
34480
34480
  // This is a generated file. Do not edit.
@@ -36028,8 +36028,8 @@ function $10671d0be444e08b$export$d175e66e9fcd7b75(fs, filepath, filenames, proj
36028
36028
  return fs.findAncestorFile(filenames, (0, ($parcel$interopDefault($8C1kk$path))).dirname(filepath), projectRoot);
36029
36029
  }
36030
36030
  async function $10671d0be444e08b$export$c1a4367d4847eb06(fs, filepath, filenames, projectRoot, opts) {
36031
- var ref;
36032
- let parse = (ref = opts === null || opts === void 0 ? void 0 : opts.parse) !== null && ref !== void 0 ? ref : true;
36031
+ var _opts_parse;
36032
+ let parse = (_opts_parse = opts === null || opts === void 0 ? void 0 : opts.parse) !== null && _opts_parse !== void 0 ? _opts_parse : true;
36033
36033
  let configFile = await $10671d0be444e08b$export$7eca4ea16d4c8343(fs, filepath, filenames, projectRoot);
36034
36034
  if (configFile) {
36035
36035
  let cachedOutput = $10671d0be444e08b$var$configCache.get(String(parse) + configFile);
@@ -36053,8 +36053,8 @@ async function $10671d0be444e08b$export$c1a4367d4847eb06(fs, filepath, filenames
36053
36053
  let config;
36054
36054
  if (parse === false) config = configContent;
36055
36055
  else {
36056
- var ref1;
36057
- let parse1 = (ref1 = opts === null || opts === void 0 ? void 0 : opts.parser) !== null && ref1 !== void 0 ? ref1 : $10671d0be444e08b$var$getParser(extname);
36056
+ var _opts_parser;
36057
+ let parse1 = (_opts_parser = opts === null || opts === void 0 ? void 0 : opts.parser) !== null && _opts_parser !== void 0 ? _opts_parser : $10671d0be444e08b$var$getParser(extname);
36058
36058
  try {
36059
36059
  config = parse1(configContent);
36060
36060
  } catch (e) {
@@ -36397,10 +36397,10 @@ function $bc66accb63b05e9a$export$d0d0105f44defc19({ bundle: bundle , bundleGrap
36397
36397
  if (node.type === "dependency" && node.value.specifierType === "url") urlDependencies.push(node.value);
36398
36398
  });
36399
36399
  for (let dependency of urlDependencies){
36400
- var ref;
36400
+ var _dependency_meta;
36401
36401
  if (dependency.specifierType !== "url") continue;
36402
- var ref1;
36403
- let placeholder = (ref1 = (ref = dependency.meta) === null || ref === void 0 ? void 0 : ref.placeholder) !== null && ref1 !== void 0 ? ref1 : dependency.id;
36402
+ var _dependency_meta_placeholder;
36403
+ let placeholder = (_dependency_meta_placeholder = (_dependency_meta = dependency.meta) === null || _dependency_meta === void 0 ? void 0 : _dependency_meta.placeholder) !== null && _dependency_meta_placeholder !== void 0 ? _dependency_meta_placeholder : dependency.id;
36404
36404
  (0, ($parcel$interopDefault($8C1kk$assert)))(typeof placeholder === "string");
36405
36405
  let resolved = bundleGraph.getReferencedBundle(dependency, bundle);
36406
36406
  if (resolved == null) {
@@ -36434,9 +36434,9 @@ async function $bc66accb63b05e9a$export$f074a8f9bef628fd({ bundle: bundle , bund
36434
36434
  let packagedContents = (packagedBundle.contents instanceof (0, $8C1kk$stream.Readable) ? await (0, $29bb96d8a6524ff0$export$f109d1c79a5ae5a1)(packagedBundle.contents) : packagedBundle.contents).toString();
36435
36435
  let inlineType = (0, (/*@__PURE__*/$parcel$interopDefault($812806c6461f2963$exports)))(entryBundle.getMainEntry()).meta.inlineType;
36436
36436
  if (inlineType == null || inlineType === "string") {
36437
- var ref;
36438
- var ref1;
36439
- let placeholder = (ref1 = (ref = dependency.meta) === null || ref === void 0 ? void 0 : ref.placeholder) !== null && ref1 !== void 0 ? ref1 : dependency.id;
36437
+ var _dependency_meta;
36438
+ var _dependency_meta_placeholder;
36439
+ let placeholder = (_dependency_meta_placeholder = (_dependency_meta = dependency.meta) === null || _dependency_meta === void 0 ? void 0 : _dependency_meta.placeholder) !== null && _dependency_meta_placeholder !== void 0 ? _dependency_meta_placeholder : dependency.id;
36440
36440
  (0, ($parcel$interopDefault($8C1kk$assert)))(typeof placeholder === "string");
36441
36441
  replacements.set(placeholder, getInlineReplacement(dependency, inlineType, packagedContents));
36442
36442
  }
@@ -36444,7 +36444,7 @@ async function $bc66accb63b05e9a$export$f074a8f9bef628fd({ bundle: bundle , bund
36444
36444
  return $bc66accb63b05e9a$var$performReplacement(replacements, contents, map);
36445
36445
  }
36446
36446
  function $bc66accb63b05e9a$export$a22ef0cbdf8abc95({ dependency: dependency , fromBundle: fromBundle , toBundle: toBundle , relative: relative , getReplacement: getReplacement }) {
36447
- var ref;
36447
+ var _dependency_meta;
36448
36448
  let to;
36449
36449
  let orig = (0, ($parcel$interopDefault($8C1kk$url))).parse(dependency.specifier);
36450
36450
  if (relative) {
@@ -36460,8 +36460,8 @@ function $bc66accb63b05e9a$export$a22ef0cbdf8abc95({ dependency: dependency , fr
36460
36460
  pathname: (0, (/*@__PURE__*/$parcel$interopDefault($812806c6461f2963$exports)))(toBundle.name),
36461
36461
  hash: orig.hash
36462
36462
  }));
36463
- var ref1;
36464
- let placeholder = (ref1 = (ref = dependency.meta) === null || ref === void 0 ? void 0 : ref.placeholder) !== null && ref1 !== void 0 ? ref1 : dependency.id;
36463
+ var _dependency_meta_placeholder;
36464
+ let placeholder = (_dependency_meta_placeholder = (_dependency_meta = dependency.meta) === null || _dependency_meta === void 0 ? void 0 : _dependency_meta.placeholder) !== null && _dependency_meta_placeholder !== void 0 ? _dependency_meta_placeholder : dependency.id;
36465
36465
  (0, ($parcel$interopDefault($8C1kk$assert)))(typeof placeholder === "string");
36466
36466
  return {
36467
36467
  from: placeholder,