@parcel/utils 2.0.0-nightly.1471 → 2.0.0-nightly.1481

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
@@ -31792,6 +31792,7 @@ var $317df5a2d050a904$exports = {};
31792
31792
  Object.defineProperty($317df5a2d050a904$exports, "__esModule", {
31793
31793
  value: true
31794
31794
  });
31795
+ $317df5a2d050a904$exports.Settings = $317df5a2d050a904$exports.walkStream = $317df5a2d050a904$exports.walkSync = $317df5a2d050a904$exports.walk = void 0;
31795
31796
  var $5b03973b11b9b194$exports = {};
31796
31797
  "use strict";
31797
31798
  Object.defineProperty($5b03973b11b9b194$exports, "__esModule", {
@@ -31808,29 +31809,43 @@ var $e0d812f240931569$exports = {};
31808
31809
  Object.defineProperty($e0d812f240931569$exports, "__esModule", {
31809
31810
  value: true
31810
31811
  });
31812
+ $e0d812f240931569$exports.Settings = $e0d812f240931569$exports.scandirSync = $e0d812f240931569$exports.scandir = void 0;
31811
31813
  var $8c82b681478b71a0$exports = {};
31812
31814
  "use strict";
31813
31815
  Object.defineProperty($8c82b681478b71a0$exports, "__esModule", {
31814
31816
  value: true
31815
31817
  });
31818
+ $8c82b681478b71a0$exports.readdir = $8c82b681478b71a0$exports.readdirWithFileTypes = $8c82b681478b71a0$exports.read = void 0;
31816
31819
  var $48b7d65b50efb0b8$exports = {};
31817
31820
  "use strict";
31818
31821
  Object.defineProperty($48b7d65b50efb0b8$exports, "__esModule", {
31819
31822
  value: true
31820
31823
  });
31824
+ $48b7d65b50efb0b8$exports.statSync = $48b7d65b50efb0b8$exports.stat = $48b7d65b50efb0b8$exports.Settings = void 0;
31821
31825
  var $79e2bbccd27c60ef$exports = {};
31822
31826
  "use strict";
31823
31827
  Object.defineProperty($79e2bbccd27c60ef$exports, "__esModule", {
31824
31828
  value: true
31825
31829
  });
31830
+ $79e2bbccd27c60ef$exports.read = void 0;
31826
31831
  function $79e2bbccd27c60ef$var$read(path, settings, callback) {
31827
31832
  settings.fs.lstat(path, (lstatError, lstat)=>{
31828
- if (lstatError !== null) return $79e2bbccd27c60ef$var$callFailureCallback(callback, lstatError);
31829
- if (!lstat.isSymbolicLink() || !settings.followSymbolicLink) return $79e2bbccd27c60ef$var$callSuccessCallback(callback, lstat);
31833
+ if (lstatError !== null) {
31834
+ $79e2bbccd27c60ef$var$callFailureCallback(callback, lstatError);
31835
+ return;
31836
+ }
31837
+ if (!lstat.isSymbolicLink() || !settings.followSymbolicLink) {
31838
+ $79e2bbccd27c60ef$var$callSuccessCallback(callback, lstat);
31839
+ return;
31840
+ }
31830
31841
  settings.fs.stat(path, (statError, stat)=>{
31831
31842
  if (statError !== null) {
31832
- if (settings.throwErrorOnBrokenSymbolicLink) return $79e2bbccd27c60ef$var$callFailureCallback(callback, statError);
31833
- return $79e2bbccd27c60ef$var$callSuccessCallback(callback, lstat);
31843
+ if (settings.throwErrorOnBrokenSymbolicLink) {
31844
+ $79e2bbccd27c60ef$var$callFailureCallback(callback, statError);
31845
+ return;
31846
+ }
31847
+ $79e2bbccd27c60ef$var$callSuccessCallback(callback, lstat);
31848
+ return;
31834
31849
  }
31835
31850
  if (settings.markSymbolicLink) stat.isSymbolicLink = ()=>true;
31836
31851
  $79e2bbccd27c60ef$var$callSuccessCallback(callback, stat);
@@ -31851,6 +31866,7 @@ var $3454c7a954c13fc6$exports = {};
31851
31866
  Object.defineProperty($3454c7a954c13fc6$exports, "__esModule", {
31852
31867
  value: true
31853
31868
  });
31869
+ $3454c7a954c13fc6$exports.read = void 0;
31854
31870
  function $3454c7a954c13fc6$var$read(path, settings) {
31855
31871
  const lstat = settings.fs.lstatSync(path);
31856
31872
  if (!lstat.isSymbolicLink() || !settings.followSymbolicLink) return lstat;
@@ -31876,6 +31892,7 @@ var $8b5ba49f0cfc39f7$exports = {};
31876
31892
  Object.defineProperty($8b5ba49f0cfc39f7$exports, "__esModule", {
31877
31893
  value: true
31878
31894
  });
31895
+ $8b5ba49f0cfc39f7$exports.createFileSystemAdapter = $8b5ba49f0cfc39f7$exports.FILE_SYSTEM_ADAPTER = void 0;
31879
31896
 
31880
31897
  $8b5ba49f0cfc39f7$exports.FILE_SYSTEM_ADAPTER = {
31881
31898
  lstat: $eJUMF$fs.lstat,
@@ -31899,7 +31916,7 @@ class $0beccc825807a5ff$var$Settings {
31899
31916
  this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, true);
31900
31917
  }
31901
31918
  _getValue(option, value) {
31902
- return option === undefined ? value : option;
31919
+ return option !== null && option !== void 0 ? option : value;
31903
31920
  }
31904
31921
  }
31905
31922
  $0beccc825807a5ff$exports.default = $0beccc825807a5ff$var$Settings;
@@ -31907,7 +31924,10 @@ $0beccc825807a5ff$exports.default = $0beccc825807a5ff$var$Settings;
31907
31924
 
31908
31925
  $48b7d65b50efb0b8$exports.Settings = $0beccc825807a5ff$exports.default;
31909
31926
  function $48b7d65b50efb0b8$var$stat(path, optionsOrSettingsOrCallback, callback) {
31910
- if (typeof optionsOrSettingsOrCallback === "function") return $79e2bbccd27c60ef$exports.read(path, $48b7d65b50efb0b8$var$getSettings(), optionsOrSettingsOrCallback);
31927
+ if (typeof optionsOrSettingsOrCallback === "function") {
31928
+ $79e2bbccd27c60ef$exports.read(path, $48b7d65b50efb0b8$var$getSettings(), optionsOrSettingsOrCallback);
31929
+ return;
31930
+ }
31911
31931
  $79e2bbccd27c60ef$exports.read(path, $48b7d65b50efb0b8$var$getSettings(optionsOrSettingsOrCallback), callback);
31912
31932
  }
31913
31933
  $48b7d65b50efb0b8$exports.stat = $48b7d65b50efb0b8$var$stat;
@@ -31970,16 +31990,7 @@ var $f4853698f1f81687$exports = {};
31970
31990
  Object.defineProperty($f4853698f1f81687$exports, "__esModule", {
31971
31991
  value: true
31972
31992
  });
31973
- const $f4853698f1f81687$var$NODE_PROCESS_VERSION_PARTS = process.versions.node.split(".");
31974
- const $f4853698f1f81687$var$MAJOR_VERSION = parseInt($f4853698f1f81687$var$NODE_PROCESS_VERSION_PARTS[0], 10);
31975
- const $f4853698f1f81687$var$MINOR_VERSION = parseInt($f4853698f1f81687$var$NODE_PROCESS_VERSION_PARTS[1], 10);
31976
- const $f4853698f1f81687$var$SUPPORTED_MAJOR_VERSION = 10;
31977
- const $f4853698f1f81687$var$SUPPORTED_MINOR_VERSION = 10;
31978
- const $f4853698f1f81687$var$IS_MATCHED_BY_MAJOR = $f4853698f1f81687$var$MAJOR_VERSION > $f4853698f1f81687$var$SUPPORTED_MAJOR_VERSION;
31979
- const $f4853698f1f81687$var$IS_MATCHED_BY_MAJOR_AND_MINOR = $f4853698f1f81687$var$MAJOR_VERSION === $f4853698f1f81687$var$SUPPORTED_MAJOR_VERSION && $f4853698f1f81687$var$MINOR_VERSION >= $f4853698f1f81687$var$SUPPORTED_MINOR_VERSION;
31980
- /**
31981
- * IS `true` for Node.js 10.10 and greater.
31982
- */ $f4853698f1f81687$exports.IS_SUPPORT_READDIR_WITH_FILE_TYPES = $f4853698f1f81687$var$IS_MATCHED_BY_MAJOR || $f4853698f1f81687$var$IS_MATCHED_BY_MAJOR_AND_MINOR;
31993
+ $f4853698f1f81687$exports.IS_SUPPORT_READDIR_WITH_FILE_TYPES = true;
31983
31994
 
31984
31995
 
31985
31996
  var $9793ec236c80d044$exports = {};
@@ -31987,11 +31998,13 @@ var $9793ec236c80d044$exports = {};
31987
31998
  Object.defineProperty($9793ec236c80d044$exports, "__esModule", {
31988
31999
  value: true
31989
32000
  });
32001
+ $9793ec236c80d044$exports.fs = void 0;
31990
32002
  var $388b7846d9ee0898$exports = {};
31991
32003
  "use strict";
31992
32004
  Object.defineProperty($388b7846d9ee0898$exports, "__esModule", {
31993
32005
  value: true
31994
32006
  });
32007
+ $388b7846d9ee0898$exports.createDirentFromStats = void 0;
31995
32008
  class $388b7846d9ee0898$var$DirentFromStats {
31996
32009
  constructor(name, stats){
31997
32010
  this.name = name;
@@ -32013,25 +32026,52 @@ $388b7846d9ee0898$exports.createDirentFromStats = $388b7846d9ee0898$var$createDi
32013
32026
  $9793ec236c80d044$exports.fs = $388b7846d9ee0898$exports;
32014
32027
 
32015
32028
 
32029
+ var $743d85a8d1333002$exports = {};
32030
+ "use strict";
32031
+ Object.defineProperty($743d85a8d1333002$exports, "__esModule", {
32032
+ value: true
32033
+ });
32034
+ $743d85a8d1333002$exports.joinPathSegments = void 0;
32035
+ function $743d85a8d1333002$var$joinPathSegments(a, b, separator) {
32036
+ /**
32037
+ * The correct handling of cases when the first segment is a root (`/`, `C:/`) or UNC path (`//?/C:/`).
32038
+ */ if (a.endsWith(separator)) return a + b;
32039
+ return a + separator + b;
32040
+ }
32041
+ $743d85a8d1333002$exports.joinPathSegments = $743d85a8d1333002$var$joinPathSegments;
32042
+
32043
+
32016
32044
  function $8c82b681478b71a0$var$read(directory, settings, callback) {
32017
- if (!settings.stats && $f4853698f1f81687$exports.IS_SUPPORT_READDIR_WITH_FILE_TYPES) return $8c82b681478b71a0$var$readdirWithFileTypes(directory, settings, callback);
32018
- return $8c82b681478b71a0$var$readdir(directory, settings, callback);
32045
+ if (!settings.stats && $f4853698f1f81687$exports.IS_SUPPORT_READDIR_WITH_FILE_TYPES) {
32046
+ $8c82b681478b71a0$var$readdirWithFileTypes(directory, settings, callback);
32047
+ return;
32048
+ }
32049
+ $8c82b681478b71a0$var$readdir(directory, settings, callback);
32019
32050
  }
32020
32051
  $8c82b681478b71a0$exports.read = $8c82b681478b71a0$var$read;
32021
32052
  function $8c82b681478b71a0$var$readdirWithFileTypes(directory, settings, callback) {
32022
32053
  settings.fs.readdir(directory, {
32023
32054
  withFileTypes: true
32024
32055
  }, (readdirError, dirents)=>{
32025
- if (readdirError !== null) return $8c82b681478b71a0$var$callFailureCallback(callback, readdirError);
32056
+ if (readdirError !== null) {
32057
+ $8c82b681478b71a0$var$callFailureCallback(callback, readdirError);
32058
+ return;
32059
+ }
32026
32060
  const entries = dirents.map((dirent)=>({
32027
32061
  dirent: dirent,
32028
32062
  name: dirent.name,
32029
- path: `${directory}${settings.pathSegmentSeparator}${dirent.name}`
32063
+ path: $743d85a8d1333002$exports.joinPathSegments(directory, dirent.name, settings.pathSegmentSeparator)
32030
32064
  }));
32031
- if (!settings.followSymbolicLinks) return $8c82b681478b71a0$var$callSuccessCallback(callback, entries);
32065
+ if (!settings.followSymbolicLinks) {
32066
+ $8c82b681478b71a0$var$callSuccessCallback(callback, entries);
32067
+ return;
32068
+ }
32032
32069
  const tasks = entries.map((entry)=>$8c82b681478b71a0$var$makeRplTaskEntry(entry, settings));
32033
32070
  $811497678ff58323$exports(tasks, (rplError, rplEntries)=>{
32034
- if (rplError !== null) return $8c82b681478b71a0$var$callFailureCallback(callback, rplError);
32071
+ if (rplError !== null) {
32072
+ $8c82b681478b71a0$var$callFailureCallback(callback, rplError);
32073
+ return;
32074
+ }
32035
32075
  $8c82b681478b71a0$var$callSuccessCallback(callback, rplEntries);
32036
32076
  });
32037
32077
  });
@@ -32039,37 +32079,53 @@ function $8c82b681478b71a0$var$readdirWithFileTypes(directory, settings, callbac
32039
32079
  $8c82b681478b71a0$exports.readdirWithFileTypes = $8c82b681478b71a0$var$readdirWithFileTypes;
32040
32080
  function $8c82b681478b71a0$var$makeRplTaskEntry(entry, settings) {
32041
32081
  return (done)=>{
32042
- if (!entry.dirent.isSymbolicLink()) return done(null, entry);
32082
+ if (!entry.dirent.isSymbolicLink()) {
32083
+ done(null, entry);
32084
+ return;
32085
+ }
32043
32086
  settings.fs.stat(entry.path, (statError, stats)=>{
32044
32087
  if (statError !== null) {
32045
- if (settings.throwErrorOnBrokenSymbolicLink) return done(statError);
32046
- return done(null, entry);
32088
+ if (settings.throwErrorOnBrokenSymbolicLink) {
32089
+ done(statError);
32090
+ return;
32091
+ }
32092
+ done(null, entry);
32093
+ return;
32047
32094
  }
32048
32095
  entry.dirent = $9793ec236c80d044$exports.fs.createDirentFromStats(entry.name, stats);
32049
- return done(null, entry);
32096
+ done(null, entry);
32050
32097
  });
32051
32098
  };
32052
32099
  }
32053
32100
  function $8c82b681478b71a0$var$readdir(directory, settings, callback) {
32054
32101
  settings.fs.readdir(directory, (readdirError, names)=>{
32055
- if (readdirError !== null) return $8c82b681478b71a0$var$callFailureCallback(callback, readdirError);
32056
- const filepaths = names.map((name)=>`${directory}${settings.pathSegmentSeparator}${name}`);
32057
- const tasks = filepaths.map((filepath)=>{
32058
- return (done)=>$48b7d65b50efb0b8$exports.stat(filepath, settings.fsStatSettings, done);
32102
+ if (readdirError !== null) {
32103
+ $8c82b681478b71a0$var$callFailureCallback(callback, readdirError);
32104
+ return;
32105
+ }
32106
+ const tasks = names.map((name)=>{
32107
+ const path = $743d85a8d1333002$exports.joinPathSegments(directory, name, settings.pathSegmentSeparator);
32108
+ return (done)=>{
32109
+ $48b7d65b50efb0b8$exports.stat(path, settings.fsStatSettings, (error, stats)=>{
32110
+ if (error !== null) {
32111
+ done(error);
32112
+ return;
32113
+ }
32114
+ const entry = {
32115
+ name: name,
32116
+ path: path,
32117
+ dirent: $9793ec236c80d044$exports.fs.createDirentFromStats(name, stats)
32118
+ };
32119
+ if (settings.stats) entry.stats = stats;
32120
+ done(null, entry);
32121
+ });
32122
+ };
32059
32123
  });
32060
- $811497678ff58323$exports(tasks, (rplError, results)=>{
32061
- if (rplError !== null) return $8c82b681478b71a0$var$callFailureCallback(callback, rplError);
32062
- const entries = [];
32063
- names.forEach((name, index)=>{
32064
- const stats = results[index];
32065
- const entry = {
32066
- name: name,
32067
- path: filepaths[index],
32068
- dirent: $9793ec236c80d044$exports.fs.createDirentFromStats(name, stats)
32069
- };
32070
- if (settings.stats) entry.stats = stats;
32071
- entries.push(entry);
32072
- });
32124
+ $811497678ff58323$exports(tasks, (rplError, entries)=>{
32125
+ if (rplError !== null) {
32126
+ $8c82b681478b71a0$var$callFailureCallback(callback, rplError);
32127
+ return;
32128
+ }
32073
32129
  $8c82b681478b71a0$var$callSuccessCallback(callback, entries);
32074
32130
  });
32075
32131
  });
@@ -32088,6 +32144,8 @@ var $e69266c637240849$exports = {};
32088
32144
  Object.defineProperty($e69266c637240849$exports, "__esModule", {
32089
32145
  value: true
32090
32146
  });
32147
+ $e69266c637240849$exports.readdir = $e69266c637240849$exports.readdirWithFileTypes = $e69266c637240849$exports.read = void 0;
32148
+
32091
32149
 
32092
32150
 
32093
32151
 
@@ -32104,7 +32162,7 @@ function $e69266c637240849$var$readdirWithFileTypes(directory, settings) {
32104
32162
  const entry = {
32105
32163
  dirent: dirent,
32106
32164
  name: dirent.name,
32107
- path: `${directory}${settings.pathSegmentSeparator}${dirent.name}`
32165
+ path: $743d85a8d1333002$exports.joinPathSegments(directory, dirent.name, settings.pathSegmentSeparator)
32108
32166
  };
32109
32167
  if (entry.dirent.isSymbolicLink() && settings.followSymbolicLinks) try {
32110
32168
  const stats = settings.fs.statSync(entry.path);
@@ -32119,7 +32177,7 @@ $e69266c637240849$exports.readdirWithFileTypes = $e69266c637240849$var$readdirWi
32119
32177
  function $e69266c637240849$var$readdir(directory, settings) {
32120
32178
  const names = settings.fs.readdirSync(directory);
32121
32179
  return names.map((name)=>{
32122
- const entryPath = `${directory}${settings.pathSegmentSeparator}${name}`;
32180
+ const entryPath = $743d85a8d1333002$exports.joinPathSegments(directory, name, settings.pathSegmentSeparator);
32123
32181
  const stats = $48b7d65b50efb0b8$exports.statSync(entryPath, settings.fsStatSettings);
32124
32182
  const entry = {
32125
32183
  name: name,
@@ -32145,6 +32203,7 @@ var $775521ec67a4fc64$exports = {};
32145
32203
  Object.defineProperty($775521ec67a4fc64$exports, "__esModule", {
32146
32204
  value: true
32147
32205
  });
32206
+ $775521ec67a4fc64$exports.createFileSystemAdapter = $775521ec67a4fc64$exports.FILE_SYSTEM_ADAPTER = void 0;
32148
32207
 
32149
32208
  $775521ec67a4fc64$exports.FILE_SYSTEM_ADAPTER = {
32150
32209
  lstat: $eJUMF$fs.lstat,
@@ -32176,7 +32235,7 @@ class $a5cd045e5a6748b0$var$Settings {
32176
32235
  });
32177
32236
  }
32178
32237
  _getValue(option, value) {
32179
- return option === undefined ? value : option;
32238
+ return option !== null && option !== void 0 ? option : value;
32180
32239
  }
32181
32240
  }
32182
32241
  $a5cd045e5a6748b0$exports.default = $a5cd045e5a6748b0$var$Settings;
@@ -32184,7 +32243,10 @@ $a5cd045e5a6748b0$exports.default = $a5cd045e5a6748b0$var$Settings;
32184
32243
 
32185
32244
  $e0d812f240931569$exports.Settings = $a5cd045e5a6748b0$exports.default;
32186
32245
  function $e0d812f240931569$var$scandir(path, optionsOrSettingsOrCallback, callback) {
32187
- if (typeof optionsOrSettingsOrCallback === "function") return $8c82b681478b71a0$exports.read(path, $e0d812f240931569$var$getSettings(), optionsOrSettingsOrCallback);
32246
+ if (typeof optionsOrSettingsOrCallback === "function") {
32247
+ $8c82b681478b71a0$exports.read(path, $e0d812f240931569$var$getSettings(), optionsOrSettingsOrCallback);
32248
+ return;
32249
+ }
32188
32250
  $8c82b681478b71a0$exports.read(path, $e0d812f240931569$var$getSettings(optionsOrSettingsOrCallback), callback);
32189
32251
  }
32190
32252
  $e0d812f240931569$exports.scandir = $e0d812f240931569$var$scandir;
@@ -32370,6 +32432,7 @@ var $d842871c1b1b7421$exports = {};
32370
32432
  Object.defineProperty($d842871c1b1b7421$exports, "__esModule", {
32371
32433
  value: true
32372
32434
  });
32435
+ $d842871c1b1b7421$exports.joinPathSegments = $d842871c1b1b7421$exports.replacePathSegmentSeparator = $d842871c1b1b7421$exports.isAppliedFilter = $d842871c1b1b7421$exports.isFatalError = void 0;
32373
32436
  function $d842871c1b1b7421$var$isFatalError(settings, error) {
32374
32437
  if (settings.errorFilter === null) return true;
32375
32438
  return !settings.errorFilter(error);
@@ -32380,11 +32443,14 @@ function $d842871c1b1b7421$var$isAppliedFilter(filter, value) {
32380
32443
  }
32381
32444
  $d842871c1b1b7421$exports.isAppliedFilter = $d842871c1b1b7421$var$isAppliedFilter;
32382
32445
  function $d842871c1b1b7421$var$replacePathSegmentSeparator(filepath, separator) {
32383
- return filepath.split(/[\\/]/).join(separator);
32446
+ return filepath.split(/[/\\]/).join(separator);
32384
32447
  }
32385
32448
  $d842871c1b1b7421$exports.replacePathSegmentSeparator = $d842871c1b1b7421$var$replacePathSegmentSeparator;
32386
32449
  function $d842871c1b1b7421$var$joinPathSegments(a, b, separator) {
32387
32450
  if (a === "") return b;
32451
+ /**
32452
+ * The correct handling of cases when the first segment is a root (`/`, `C:/`) or UNC path (`//?/C:/`).
32453
+ */ if (a.endsWith(separator)) return a + b;
32388
32454
  return a + separator + b;
32389
32455
  }
32390
32456
  $d842871c1b1b7421$exports.joinPathSegments = $d842871c1b1b7421$var$joinPathSegments;
@@ -32427,6 +32493,9 @@ class $b02d22213ae11a8a$var$AsyncReader extends $4be968f0d018c0c1$exports.defaul
32427
32493
  });
32428
32494
  return this._emitter;
32429
32495
  }
32496
+ get isDestroyed() {
32497
+ return this._isDestroyed;
32498
+ }
32430
32499
  destroy() {
32431
32500
  if (this._isDestroyed) throw new Error("The reader is already destroyed");
32432
32501
  this._isDestroyed = true;
@@ -32452,13 +32521,16 @@ class $b02d22213ae11a8a$var$AsyncReader extends $4be968f0d018c0c1$exports.defaul
32452
32521
  }
32453
32522
  _worker(item, done) {
32454
32523
  this._scandir(item.directory, this._settings.fsScandirSettings, (error, entries)=>{
32455
- if (error !== null) return done(error, undefined);
32524
+ if (error !== null) {
32525
+ done(error, undefined);
32526
+ return;
32527
+ }
32456
32528
  for (const entry of entries)this._handleEntry(entry, item.base);
32457
32529
  done(null, undefined);
32458
32530
  });
32459
32531
  }
32460
32532
  _handleError(error) {
32461
- if (!$d842871c1b1b7421$exports.isFatalError(this._settings, error)) return;
32533
+ if (this._isDestroyed || !$d842871c1b1b7421$exports.isFatalError(this._settings, error)) return;
32462
32534
  this._isFatalError = true;
32463
32535
  this._isDestroyed = true;
32464
32536
  this._emitter.emit("error", error);
@@ -32468,7 +32540,7 @@ class $b02d22213ae11a8a$var$AsyncReader extends $4be968f0d018c0c1$exports.defaul
32468
32540
  const fullpath = entry.path;
32469
32541
  if (base !== undefined) entry.path = $d842871c1b1b7421$exports.joinPathSegments(base, entry.name, this._settings.pathSegmentSeparator);
32470
32542
  if ($d842871c1b1b7421$exports.isAppliedFilter(this._settings.entryFilter, entry)) this._emitEntry(entry);
32471
- if (entry.dirent.isDirectory() && $d842871c1b1b7421$exports.isAppliedFilter(this._settings.deepFilter, entry)) this._pushToQueue(fullpath, entry.path);
32543
+ if (entry.dirent.isDirectory() && $d842871c1b1b7421$exports.isAppliedFilter(this._settings.deepFilter, entry)) this._pushToQueue(fullpath, base === undefined ? undefined : entry.path);
32472
32544
  }
32473
32545
  _emitEntry(entry) {
32474
32546
  this._emitter.emit("entry", entry);
@@ -32482,19 +32554,17 @@ class $5b03973b11b9b194$var$AsyncProvider {
32482
32554
  this._root = _root;
32483
32555
  this._settings = _settings;
32484
32556
  this._reader = new $b02d22213ae11a8a$exports.default(this._root, this._settings);
32485
- this._storage = new Set();
32557
+ this._storage = [];
32486
32558
  }
32487
32559
  read(callback) {
32488
32560
  this._reader.onError((error)=>{
32489
32561
  $5b03973b11b9b194$var$callFailureCallback(callback, error);
32490
32562
  });
32491
32563
  this._reader.onEntry((entry)=>{
32492
- this._storage.add(entry);
32564
+ this._storage.push(entry);
32493
32565
  });
32494
32566
  this._reader.onEnd(()=>{
32495
- $5b03973b11b9b194$var$callSuccessCallback(callback, [
32496
- ...this._storage
32497
- ]);
32567
+ $5b03973b11b9b194$var$callSuccessCallback(callback, this._storage);
32498
32568
  });
32499
32569
  this._reader.read();
32500
32570
  }
@@ -32523,7 +32593,9 @@ class $327790ac3132dcf6$var$StreamProvider {
32523
32593
  this._stream = new $eJUMF$stream.Readable({
32524
32594
  objectMode: true,
32525
32595
  read: ()=>{},
32526
- destroy: this._reader.destroy.bind(this._reader)
32596
+ destroy: ()=>{
32597
+ if (!this._reader.isDestroyed) this._reader.destroy();
32598
+ }
32527
32599
  });
32528
32600
  }
32529
32601
  read() {
@@ -32560,15 +32632,13 @@ class $c5f7cf7adb14757e$var$SyncReader extends $4be968f0d018c0c1$exports.default
32560
32632
  constructor(){
32561
32633
  super(...arguments);
32562
32634
  this._scandir = $e0d812f240931569$exports.scandirSync;
32563
- this._storage = new Set();
32635
+ this._storage = [];
32564
32636
  this._queue = new Set();
32565
32637
  }
32566
32638
  read() {
32567
32639
  this._pushToQueue(this._root, this._settings.basePath);
32568
32640
  this._handleQueue();
32569
- return [
32570
- ...this._storage
32571
- ];
32641
+ return this._storage;
32572
32642
  }
32573
32643
  _pushToQueue(directory, base) {
32574
32644
  this._queue.add({
@@ -32595,10 +32665,10 @@ class $c5f7cf7adb14757e$var$SyncReader extends $4be968f0d018c0c1$exports.default
32595
32665
  const fullpath = entry.path;
32596
32666
  if (base !== undefined) entry.path = $d842871c1b1b7421$exports.joinPathSegments(base, entry.name, this._settings.pathSegmentSeparator);
32597
32667
  if ($d842871c1b1b7421$exports.isAppliedFilter(this._settings.entryFilter, entry)) this._pushToStorage(entry);
32598
- if (entry.dirent.isDirectory() && $d842871c1b1b7421$exports.isAppliedFilter(this._settings.deepFilter, entry)) this._pushToQueue(fullpath, entry.path);
32668
+ if (entry.dirent.isDirectory() && $d842871c1b1b7421$exports.isAppliedFilter(this._settings.deepFilter, entry)) this._pushToQueue(fullpath, base === undefined ? undefined : entry.path);
32599
32669
  }
32600
32670
  _pushToStorage(entry) {
32601
- this._storage.add(entry);
32671
+ this._storage.push(entry);
32602
32672
  }
32603
32673
  }
32604
32674
  $c5f7cf7adb14757e$exports.default = $c5f7cf7adb14757e$var$SyncReader;
@@ -32628,7 +32698,7 @@ class $8d237ca08a544ff3$var$Settings {
32628
32698
  constructor(_options = {}){
32629
32699
  this._options = _options;
32630
32700
  this.basePath = this._getValue(this._options.basePath, undefined);
32631
- this.concurrency = this._getValue(this._options.concurrency, Infinity);
32701
+ this.concurrency = this._getValue(this._options.concurrency, Number.POSITIVE_INFINITY);
32632
32702
  this.deepFilter = this._getValue(this._options.deepFilter, null);
32633
32703
  this.entryFilter = this._getValue(this._options.entryFilter, null);
32634
32704
  this.errorFilter = this._getValue(this._options.errorFilter, null);
@@ -32642,7 +32712,7 @@ class $8d237ca08a544ff3$var$Settings {
32642
32712
  });
32643
32713
  }
32644
32714
  _getValue(option, value) {
32645
- return option === undefined ? value : option;
32715
+ return option !== null && option !== void 0 ? option : value;
32646
32716
  }
32647
32717
  }
32648
32718
  $8d237ca08a544ff3$exports.default = $8d237ca08a544ff3$var$Settings;
@@ -32650,7 +32720,10 @@ $8d237ca08a544ff3$exports.default = $8d237ca08a544ff3$var$Settings;
32650
32720
 
32651
32721
  $317df5a2d050a904$exports.Settings = $8d237ca08a544ff3$exports.default;
32652
32722
  function $317df5a2d050a904$var$walk(directory, optionsOrSettingsOrCallback, callback) {
32653
- if (typeof optionsOrSettingsOrCallback === "function") return new $5b03973b11b9b194$exports.default(directory, $317df5a2d050a904$var$getSettings()).read(optionsOrSettingsOrCallback);
32723
+ if (typeof optionsOrSettingsOrCallback === "function") {
32724
+ new $5b03973b11b9b194$exports.default(directory, $317df5a2d050a904$var$getSettings()).read(optionsOrSettingsOrCallback);
32725
+ return;
32726
+ }
32654
32727
  new $5b03973b11b9b194$exports.default(directory, $317df5a2d050a904$var$getSettings(optionsOrSettingsOrCallback)).read(callback);
32655
32728
  }
32656
32729
  $317df5a2d050a904$exports.walk = $317df5a2d050a904$var$walk;
@@ -34855,73 +34928,84 @@ else $152536acc51e0ffd$exports = $152536acc51e0ffd$var$isWsl();
34855
34928
 
34856
34929
 
34857
34930
  const $de07249fe885e737$var$pAccess = $de07249fe885e737$require$promisify($eJUMF$fs.access);
34858
- const $de07249fe885e737$var$pExecFile = $de07249fe885e737$require$promisify($eJUMF$child_process.execFile);
34931
+ const $de07249fe885e737$var$pReadFile = $de07249fe885e737$require$promisify($eJUMF$fs.readFile);
34859
34932
  // Path to included `xdg-open`.
34860
34933
  const $de07249fe885e737$var$localXdgOpenPath = $eJUMF$path.join($de07249fe885e737$var$$parcel$__dirname, "xdg-open");
34861
- // Convert a path from WSL format to Windows format:
34862
- // `/mnt/c/Program Files/Example/MyApp.exe` `C:\Program Files\Example\MyApp.exe`
34863
- const $de07249fe885e737$var$wslToWindowsPath = async (path)=>{
34864
- const { stdout: stdout } = await $de07249fe885e737$var$pExecFile("wslpath", [
34865
- "-w",
34866
- path
34867
- ]);
34868
- return stdout.trim();
34869
- };
34934
+ /**
34935
+ Get the mount point for fixed drives in WSL.
34936
+
34937
+ @inner
34938
+ @returns {string} The mount point.
34939
+ */ const $de07249fe885e737$var$getWslDrivesMountPoint = (()=>{
34940
+ // Default value for "root" param
34941
+ // according to https://docs.microsoft.com/en-us/windows/wsl/wsl-config
34942
+ const defaultMountPoint = "/mnt/";
34943
+ let mountPoint;
34944
+ return async function() {
34945
+ if (mountPoint) // Return memoized mount point value
34946
+ return mountPoint;
34947
+ const configFilePath = "/etc/wsl.conf";
34948
+ let isConfigFileExists = false;
34949
+ try {
34950
+ await $de07249fe885e737$var$pAccess(configFilePath, $eJUMF$fs.constants.F_OK);
34951
+ isConfigFileExists = true;
34952
+ } catch (_) {}
34953
+ if (!isConfigFileExists) return defaultMountPoint;
34954
+ const configContent = await $de07249fe885e737$var$pReadFile(configFilePath, {
34955
+ encoding: "utf8"
34956
+ });
34957
+ const configMountPoint = /root\s*=\s*(.*)/g.exec(configContent);
34958
+ if (!configMountPoint) return defaultMountPoint;
34959
+ mountPoint = configMountPoint[1].trim();
34960
+ mountPoint = mountPoint.endsWith("/") ? mountPoint : mountPoint + "/";
34961
+ return mountPoint;
34962
+ };
34963
+ })();
34870
34964
  $de07249fe885e737$exports = async (target, options)=>{
34871
34965
  if (typeof target !== "string") throw new TypeError("Expected a `target`");
34872
34966
  options = {
34873
34967
  wait: false,
34874
34968
  background: false,
34875
- url: false,
34969
+ allowNonzeroExitCode: false,
34876
34970
  ...options
34877
34971
  };
34878
34972
  let command;
34973
+ let { app: app } = options;
34879
34974
  let appArguments = [];
34880
34975
  const cliArguments = [];
34881
34976
  const childProcessOptions = {};
34882
- if (Array.isArray(options.app)) {
34883
- appArguments = options.app.slice(1);
34884
- options.app = options.app[0];
34885
- }
34886
- // Encodes the target as if it were an URL. Especially useful to get
34887
- // double-quotes through the “double-quotes on Windows caveat”, but it
34888
- // can be used on any platform.
34889
- if (options.url) {
34890
- target = encodeURI(target);
34891
- if ($152536acc51e0ffd$exports) target = target.replace(/&/g, "^&");
34977
+ if (Array.isArray(app)) {
34978
+ appArguments = app.slice(1);
34979
+ app = app[0];
34892
34980
  }
34893
34981
  if (process.platform === "darwin") {
34894
34982
  command = "open";
34895
34983
  if (options.wait) cliArguments.push("--wait-apps");
34896
34984
  if (options.background) cliArguments.push("--background");
34897
- if (options.app) cliArguments.push("-a", options.app);
34985
+ if (app) cliArguments.push("-a", app);
34898
34986
  } else if (process.platform === "win32" || $152536acc51e0ffd$exports && !$511188f033b8926c$exports()) {
34899
- command = "cmd" + ($152536acc51e0ffd$exports ? ".exe" : "");
34900
- cliArguments.push("/s", "/c", "start", '""', "/b");
34901
- if (!$152536acc51e0ffd$exports) {
34902
- // Always quoting target allows for URLs/paths to have spaces and unmarked characters, as `cmd.exe` will
34903
- // interpret them as plain text to be forwarded as one unique argument. Enabling `windowsVerbatimArguments`
34904
- // disables Node.js's default quotes and escapes handling (https://git.io/fjdem).
34905
- // References:
34906
- // - Issues #17, #44, #55, #77, #101, #115
34907
- // - Pull requests: #74, #98
34908
- //
34909
- // As a result, all double-quotes are stripped from the `target` and do not get to your desired destination.
34910
- target = `"${target}"`;
34911
- childProcessOptions.windowsVerbatimArguments = true;
34912
- if (options.app) options.app = `"${options.app}"`;
34913
- }
34914
- if (options.wait) cliArguments.push("/wait");
34915
- if (options.app) {
34916
- if ($152536acc51e0ffd$exports && options.app.startsWith("/mnt/")) {
34917
- const windowsPath = await $de07249fe885e737$var$wslToWindowsPath(options.app);
34918
- options.app = windowsPath;
34919
- }
34920
- cliArguments.push(options.app);
34921
- }
34922
- if (appArguments.length > 0) cliArguments.push(...appArguments);
34987
+ const mountPoint = await $de07249fe885e737$var$getWslDrivesMountPoint();
34988
+ command = $152536acc51e0ffd$exports ? `${mountPoint}c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe` : `${process.env.SYSTEMROOT}\\System32\\WindowsPowerShell\\v1.0\\powershell`;
34989
+ cliArguments.push("-NoProfile", "-NonInteractive", "\u2013ExecutionPolicy", "Bypass", "-EncodedCommand");
34990
+ if (!$152536acc51e0ffd$exports) childProcessOptions.windowsVerbatimArguments = true;
34991
+ const encodedArguments = [
34992
+ "Start"
34993
+ ];
34994
+ if (options.wait) encodedArguments.push("-Wait");
34995
+ if (app) {
34996
+ // Double quote with double quotes to ensure the inner quotes are passed through.
34997
+ // Inner quotes are delimited for PowerShell interpretation with backticks.
34998
+ encodedArguments.push(`"\`"${app}\`""`, "-ArgumentList");
34999
+ appArguments.unshift(target);
35000
+ } else encodedArguments.push(`"${target}"`);
35001
+ if (appArguments.length > 0) {
35002
+ appArguments = appArguments.map((arg)=>`"\`"${arg}\`""`);
35003
+ encodedArguments.push(appArguments.join(","));
35004
+ }
35005
+ // Using Base64-encoded command, accepted by PowerShell, to allow special characters.
35006
+ target = Buffer.from(encodedArguments.join(" "), "utf16le").toString("base64");
34923
35007
  } else {
34924
- if (options.app) command = options.app;
35008
+ if (app) command = app;
34925
35009
  else {
34926
35010
  // When bundled by Webpack, there's no actual package file path and no local `xdg-open`.
34927
35011
  const isBundled = !$de07249fe885e737$var$$parcel$__dirname || $de07249fe885e737$var$$parcel$__dirname === "/";
@@ -34948,7 +35032,7 @@ $de07249fe885e737$exports = async (target, options)=>{
34948
35032
  if (options.wait) return new Promise((resolve, reject)=>{
34949
35033
  subprocess.once("error", reject);
34950
35034
  subprocess.once("close", (exitCode)=>{
34951
- if (exitCode > 0) {
35035
+ if (options.allowNonzeroExitCode && exitCode > 0) {
34952
35036
  reject(new Error(`Exited with code ${exitCode}`));
34953
35037
  return;
34954
35038
  }