@squiz/render-runtime-lib 1.2.1-alpha.63 → 1.2.1-alpha.70

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.
@@ -99,6 +99,8 @@ var require_bridge = __commonJS({
99
99
  var thisErrorCaptureStackTrace = Error.captureStackTrace;
100
100
  var thisSymbolToString = Symbol.prototype.toString;
101
101
  var thisSymbolToStringTag = Symbol.toStringTag;
102
+ var thisSymbolIterator = Symbol.iterator;
103
+ var thisSymbolNodeJSUtilInspectCustom = Symbol.for("nodejs.util.inspect.custom");
102
104
  var VMError = class extends Error {
103
105
  constructor(message, code) {
104
106
  super(message);
@@ -305,7 +307,10 @@ var require_bridge = __commonJS({
305
307
  class BaseHandler extends SafeBase {
306
308
  constructor(object) {
307
309
  super();
308
- this.object = object;
310
+ this.objectWrapper = () => object;
311
+ }
312
+ getObject() {
313
+ return this.objectWrapper();
309
314
  }
310
315
  getFactory() {
311
316
  return defaultFactory;
@@ -362,7 +367,7 @@ var require_bridge = __commonJS({
362
367
  throw thisUnexpected();
363
368
  }
364
369
  get(target, key, receiver) {
365
- const object = this.object;
370
+ const object = this.getObject();
366
371
  switch (key) {
367
372
  case "constructor": {
368
373
  const desc = otherSafeGetOwnPropertyDescriptor(object, key);
@@ -402,7 +407,7 @@ var require_bridge = __commonJS({
402
407
  return this.fromOtherWithContext(ret);
403
408
  }
404
409
  set(target, key, value, receiver) {
405
- const object = this.object;
410
+ const object = this.getObject();
406
411
  if (key === "__proto__" && !thisOtherHasOwnProperty(object, key)) {
407
412
  return this.setPrototypeOf(target, value);
408
413
  }
@@ -420,7 +425,7 @@ var require_bridge = __commonJS({
420
425
  throw new VMError(OPNA);
421
426
  }
422
427
  apply(target, context, args) {
423
- const object = this.object;
428
+ const object = this.getObject();
424
429
  let ret;
425
430
  try {
426
431
  context = otherFromThis(context);
@@ -432,7 +437,7 @@ var require_bridge = __commonJS({
432
437
  return thisFromOther(ret);
433
438
  }
434
439
  construct(target, args, newTarget) {
435
- const object = this.object;
440
+ const object = this.getObject();
436
441
  let ret;
437
442
  try {
438
443
  args = otherFromThisArguments(args);
@@ -443,13 +448,13 @@ var require_bridge = __commonJS({
443
448
  return thisFromOtherWithFactory(this.getFactory(), ret, thisFromOther(object));
444
449
  }
445
450
  getOwnPropertyDescriptorDesc(target, prop, desc) {
446
- const object = this.object;
451
+ const object = this.getObject();
447
452
  if (desc && typeof object === "function" && (prop === "arguments" || prop === "caller" || prop === "callee"))
448
453
  desc.value = null;
449
454
  return desc;
450
455
  }
451
456
  getOwnPropertyDescriptor(target, prop) {
452
- const object = this.object;
457
+ const object = this.getObject();
453
458
  let desc;
454
459
  try {
455
460
  desc = otherSafeGetOwnPropertyDescriptor(object, prop);
@@ -490,7 +495,7 @@ var require_bridge = __commonJS({
490
495
  return desc;
491
496
  }
492
497
  defineProperty(target, prop, desc) {
493
- const object = this.object;
498
+ const object = this.getObject();
494
499
  if (!thisReflectSetPrototypeOf(desc, null))
495
500
  throw thisUnexpected();
496
501
  desc = this.definePropertyDesc(target, prop, desc);
@@ -540,7 +545,7 @@ var require_bridge = __commonJS({
540
545
  return true;
541
546
  }
542
547
  deleteProperty(target, prop) {
543
- const object = this.object;
548
+ const object = this.getObject();
544
549
  try {
545
550
  return otherReflectDeleteProperty(object, prop) === true;
546
551
  } catch (e) {
@@ -548,7 +553,7 @@ var require_bridge = __commonJS({
548
553
  }
549
554
  }
550
555
  has(target, key) {
551
- const object = this.object;
556
+ const object = this.getObject();
552
557
  try {
553
558
  return otherReflectHas(object, key) === true;
554
559
  } catch (e) {
@@ -556,7 +561,7 @@ var require_bridge = __commonJS({
556
561
  }
557
562
  }
558
563
  isExtensible(target) {
559
- const object = this.object;
564
+ const object = this.getObject();
560
565
  try {
561
566
  if (otherReflectIsExtensible(object))
562
567
  return true;
@@ -569,7 +574,7 @@ var require_bridge = __commonJS({
569
574
  return false;
570
575
  }
571
576
  ownKeys(target) {
572
- const object = this.object;
577
+ const object = this.getObject();
573
578
  let res;
574
579
  try {
575
580
  res = otherReflectOwnKeys(object);
@@ -579,7 +584,7 @@ var require_bridge = __commonJS({
579
584
  return thisFromOther(res);
580
585
  }
581
586
  preventExtensions(target) {
582
- const object = this.object;
587
+ const object = this.getObject();
583
588
  try {
584
589
  if (!otherReflectPreventExtensions(object))
585
590
  return false;
@@ -592,7 +597,7 @@ var require_bridge = __commonJS({
592
597
  return true;
593
598
  }
594
599
  enumerate(target) {
595
- const object = this.object;
600
+ const object = this.getObject();
596
601
  let res;
597
602
  try {
598
603
  res = otherReflectEnumerate(object);
@@ -602,6 +607,9 @@ var require_bridge = __commonJS({
602
607
  return this.fromOtherWithContext(res);
603
608
  }
604
609
  }
610
+ BaseHandler.prototype[thisSymbolNodeJSUtilInspectCustom] = void 0;
611
+ BaseHandler.prototype[thisSymbolToStringTag] = "VM2 Wrapper";
612
+ BaseHandler.prototype[thisSymbolIterator] = void 0;
605
613
  function defaultFactory(object) {
606
614
  return new BaseHandler(object);
607
615
  }
@@ -668,7 +676,7 @@ var require_bridge = __commonJS({
668
676
  this.mock = mock;
669
677
  }
670
678
  get(target, key, receiver) {
671
- const object = this.object;
679
+ const object = this.getObject();
672
680
  const mock = this.mock;
673
681
  if (thisReflectApply(thisObjectHasOwnProperty, mock, key) && !thisOtherHasOwnProperty(object, key)) {
674
682
  return mock[key];
@@ -910,7 +918,7 @@ var require_compiler = __commonJS({
910
918
  return removeShebang(code);
911
919
  }
912
920
  function lookupCompiler(compiler) {
913
- if (typeof compiler === "function")
921
+ if ("function" === typeof compiler)
914
922
  return compiler;
915
923
  switch (compiler) {
916
924
  case "coffeescript":
@@ -6229,6 +6237,9 @@ ${error.stack}`;
6229
6237
  let argsOffset;
6230
6238
  if (args === null) {
6231
6239
  code = body;
6240
+ if (!/\b(?:catch|import|async)\b/.test(code)) {
6241
+ return { __proto__: null, code, hasAsync: false };
6242
+ }
6232
6243
  } else {
6233
6244
  code = isAsync ? "(async function" : "(function";
6234
6245
  if (isGenerator)
@@ -6647,7 +6658,7 @@ return exports;})`);
6647
6658
  const allowEval = options.eval !== false;
6648
6659
  const allowWasm = options.wasm !== false;
6649
6660
  const allowAsync = optAllowAsync && !options.fixAsync;
6650
- if (sandbox && typeof sandbox !== "object") {
6661
+ if (sandbox && "object" !== typeof sandbox) {
6651
6662
  throw new VMError("Sandbox must be object.");
6652
6663
  }
6653
6664
  const resolvedCompiler = lookupCompiler(compiler);
@@ -7838,7 +7849,7 @@ var require_nodevm = __commonJS({
7838
7849
  strict = false,
7839
7850
  sandbox
7840
7851
  } = options;
7841
- if (sandbox && typeof sandbox !== "object") {
7852
+ if (sandbox && "object" !== typeof sandbox) {
7842
7853
  throw new VMError("Sandbox must be an object.");
7843
7854
  }
7844
7855
  super({ __proto__: null, compiler, eval: allowEval, wasm });
@@ -7908,7 +7919,7 @@ var require_nodevm = __commonJS({
7908
7919
  }
7909
7920
  }
7910
7921
  call(method, ...args) {
7911
- if (typeof method === "function") {
7922
+ if ("function" === typeof method) {
7912
7923
  return method(...args);
7913
7924
  } else {
7914
7925
  throw new VMError("Unrecognized method type.");
@@ -7981,15 +7992,15 @@ var require_nodevm = __commonJS({
7981
7992
  static code(script2, filename, options) {
7982
7993
  let unresolvedFilename;
7983
7994
  if (filename != null) {
7984
- if (typeof filename === "object") {
7995
+ if ("object" === typeof filename) {
7985
7996
  options = filename;
7986
7997
  unresolvedFilename = options.filename;
7987
- } else if (typeof filename === "string") {
7998
+ } else if ("string" === typeof filename) {
7988
7999
  unresolvedFilename = filename;
7989
8000
  } else {
7990
8001
  throw new VMError("Invalid arguments.");
7991
8002
  }
7992
- } else if (typeof options === "object") {
8003
+ } else if ("object" === typeof options) {
7993
8004
  unresolvedFilename = options.filename;
7994
8005
  }
7995
8006
  if (arguments.length > 3) {
@@ -19690,7 +19701,7 @@ var require_jsonpointer = __commonJS({
19690
19701
  obj = obj[untilde(pointer[p++])];
19691
19702
  if (len === p)
19692
19703
  return obj;
19693
- if (typeof obj !== "object")
19704
+ if (typeof obj !== "object" || obj === null)
19694
19705
  return void 0;
19695
19706
  }
19696
19707
  }
@@ -20560,12 +20571,12 @@ var require_legacy_streams = __commonJS({
20560
20571
  if (this.encoding)
20561
20572
  this.setEncoding(this.encoding);
20562
20573
  if (this.start !== void 0) {
20563
- if (typeof this.start !== "number") {
20574
+ if ("number" !== typeof this.start) {
20564
20575
  throw TypeError("start must be a Number");
20565
20576
  }
20566
20577
  if (this.end === void 0) {
20567
20578
  this.end = Infinity;
20568
- } else if (typeof this.end !== "number") {
20579
+ } else if ("number" !== typeof this.end) {
20569
20580
  throw TypeError("end must be a Number");
20570
20581
  }
20571
20582
  if (this.start > this.end) {
@@ -20608,7 +20619,7 @@ var require_legacy_streams = __commonJS({
20608
20619
  this[key] = options[key];
20609
20620
  }
20610
20621
  if (this.start !== void 0) {
20611
- if (typeof this.start !== "number") {
20622
+ if ("number" !== typeof this.start) {
20612
20623
  throw TypeError("start must be a Number");
20613
20624
  }
20614
20625
  if (this.start < 0) {
@@ -22892,7 +22903,7 @@ var require_LoadedComponent = __commonJS({
22892
22903
  return `${this.getUniqueComponentSlug()}-${functionName}`;
22893
22904
  }
22894
22905
  getFullFunctionEntryPointFilePath(functionEntryPath) {
22895
- return path_1.default.join(this.componentFilesRoot, this.manifest.name, this.manifest.version, functionEntryPath);
22906
+ return path_1.default.resolve(path_1.default.join(this.componentFilesRoot, functionEntryPath));
22896
22907
  }
22897
22908
  };
22898
22909
  exports.LoadedComponent = LoadedComponent;
@@ -23045,28 +23056,93 @@ var require_loadManifest = __commonJS({
23045
23056
  return mod && mod.__esModule ? mod : { "default": mod };
23046
23057
  };
23047
23058
  Object.defineProperty(exports, "__esModule", { value: true });
23048
- exports.loadManifest = void 0;
23059
+ exports.findComponentManifests = exports.loadManifest = exports.ManifestValidationError = void 0;
23049
23060
  var validateManifest_1 = require_validateManifest();
23050
23061
  var path_1 = __importDefault(require("path"));
23051
23062
  var promises_1 = __importDefault(require("fs/promises"));
23052
23063
  var fs_extra_1 = __importDefault(require_lib4());
23053
23064
  var error_1 = require_error();
23054
- async function loadManifest(componentName, version, componentRoot) {
23055
- const manifestPath = path_1.default.join(componentRoot, componentName, version, "manifest.json");
23065
+ var ManifestValidationError = class extends Error {
23066
+ };
23067
+ exports.ManifestValidationError = ManifestValidationError;
23068
+ async function loadManifest(manifestPath) {
23056
23069
  if (await fs_extra_1.default.pathExists(manifestPath)) {
23057
- const manifest = JSON.parse(await promises_1.default.readFile(manifestPath, { encoding: "utf-8" }));
23058
- const manifestValidationResult = (0, validateManifest_1.validateManifest)(manifest);
23059
- if (manifestValidationResult.isValid) {
23060
- if (version !== manifest.version) {
23061
- throw new error_1.InternalServerError(`manifest version miss match, expected version ${version} does not equal loaded version ${manifest.version}`);
23062
- }
23070
+ const { manifest, validation } = await readManifest(manifestPath);
23071
+ if (!validation.isValid) {
23072
+ throw new ManifestValidationError(validation.message);
23073
+ } else {
23063
23074
  return manifest;
23064
23075
  }
23065
- throw new Error(manifestValidationResult.message);
23066
23076
  }
23067
23077
  throw new error_1.ResourceNotFoundError("manifest could not be found");
23068
23078
  }
23069
23079
  exports.loadManifest = loadManifest;
23080
+ async function readManifest(manifestPath) {
23081
+ const manifest = JSON.parse(await promises_1.default.readFile(manifestPath, { encoding: "utf-8" }));
23082
+ const manifestValidationResult = (0, validateManifest_1.validateManifest)(manifest);
23083
+ return { manifest, validation: manifestValidationResult };
23084
+ }
23085
+ async function findComponentManifests(directory, nesting = 10) {
23086
+ if (await isComponentDirectory(directory)) {
23087
+ return [await tryReadManifest(directory)];
23088
+ }
23089
+ if (nesting === 0) {
23090
+ return [];
23091
+ }
23092
+ const files = await promises_1.default.readdir(directory, { withFileTypes: true, encoding: "utf-8" });
23093
+ const nestedDirectories = files.filter((file) => file.isDirectory());
23094
+ const otherManifests = await Promise.all(nestedDirectories.map((d) => findComponentManifests(path_1.default.join(directory, d.name), nesting - 1)));
23095
+ return otherManifests.flat();
23096
+ }
23097
+ exports.findComponentManifests = findComponentManifests;
23098
+ async function isComponentDirectory(directory) {
23099
+ return fs_extra_1.default.pathExists(path_1.default.join(directory, "manifest.json"));
23100
+ }
23101
+ async function tryReadManifest(directory) {
23102
+ try {
23103
+ const { manifest, validation } = await readManifest(path_1.default.join(directory, "manifest.json"));
23104
+ if (validation.isValid) {
23105
+ return { directory, manifest, status: "valid" };
23106
+ } else {
23107
+ return {
23108
+ directory,
23109
+ manifest,
23110
+ validationError: new ManifestValidationError(validation.message),
23111
+ status: "invalid"
23112
+ };
23113
+ }
23114
+ } catch (e) {
23115
+ let message = "Unknown error occurred";
23116
+ if (e instanceof Error && e.message) {
23117
+ message = e.message;
23118
+ }
23119
+ return {
23120
+ directory,
23121
+ manifest: void 0,
23122
+ validationError: new ManifestValidationError(message),
23123
+ status: "invalid"
23124
+ };
23125
+ }
23126
+ }
23127
+ }
23128
+ });
23129
+
23130
+ // ../component-lib/lib/util/isPathTryingToAccessOutsideOfRoot.js
23131
+ var require_isPathTryingToAccessOutsideOfRoot = __commonJS({
23132
+ "../component-lib/lib/util/isPathTryingToAccessOutsideOfRoot.js"(exports) {
23133
+ "use strict";
23134
+ var __importDefault = exports && exports.__importDefault || function(mod) {
23135
+ return mod && mod.__esModule ? mod : { "default": mod };
23136
+ };
23137
+ Object.defineProperty(exports, "__esModule", { value: true });
23138
+ exports.isPathTryingToAccessOutsideOfRoot = void 0;
23139
+ var path_1 = __importDefault(require("path"));
23140
+ function isPathTryingToAccessOutsideOfRoot(rootPath, filePath) {
23141
+ const resolvedRoot = path_1.default.resolve(rootPath);
23142
+ const joinedPath = path_1.default.join(resolvedRoot, filePath);
23143
+ return !joinedPath.includes(resolvedRoot);
23144
+ }
23145
+ exports.isPathTryingToAccessOutsideOfRoot = isPathTryingToAccessOutsideOfRoot;
23070
23146
  }
23071
23147
  });
23072
23148
 
@@ -23084,25 +23160,37 @@ var require_loadComponent = __commonJS({
23084
23160
  var LoadedComponent_1 = require_LoadedComponent();
23085
23161
  var loadManifest_1 = require_loadManifest();
23086
23162
  var fs_1 = require("fs");
23087
- async function loadComponent(componentName, version, componentFileRoot, componentRootUrl, executor) {
23163
+ var isPathTryingToAccessOutsideOfRoot_1 = require_isPathTryingToAccessOutsideOfRoot();
23164
+ var error_1 = require_error();
23165
+ async function loadComponent(componentManifestPath, componentName, componentVersion, componentRootUrl, executor, loadInProductionMode) {
23088
23166
  var _a;
23089
- const manifest = await (0, loadManifest_1.loadManifest)(componentName, version, componentFileRoot);
23090
- const root = path_1.default.join(componentFileRoot, manifest.name, manifest.version);
23167
+ const componentRootPath = path_1.default.resolve(componentManifestPath, "..");
23168
+ const manifest = await (0, loadManifest_1.loadManifest)(componentManifestPath);
23091
23169
  const staticFileLocationRoot = ((_a = manifest["static-files"]) === null || _a === void 0 ? void 0 : _a["location-root"]) || "";
23092
- if (await isPathTraversing(root, staticFileLocationRoot)) {
23170
+ if ((0, isPathTryingToAccessOutsideOfRoot_1.isPathTryingToAccessOutsideOfRoot)(componentRootPath, staticFileLocationRoot)) {
23093
23171
  throw new Error(`access to a static file location root outside the parent directory in "${manifest.name} ${manifest.version}" is not alllowed`);
23094
23172
  }
23095
23173
  for (const func of manifest.functions) {
23096
- await assertFuncEntryFilesAreValid(root, manifest, func);
23174
+ await assertFuncEntryFilesAreValid(componentRootPath, manifest, func);
23097
23175
  if (func.output["response-type"] === "html" && staticFileLocationRoot) {
23098
- await assertStaticFilesAreValid(root, manifest, func, staticFileLocationRoot);
23176
+ await assertStaticFilesAreValid(componentRootPath, manifest, func, staticFileLocationRoot);
23177
+ }
23178
+ }
23179
+ const component = new LoadedComponent_1.LoadedComponent(manifest, componentRootPath, componentRootUrl, executor);
23180
+ if (loadInProductionMode) {
23181
+ const manifest2 = component.getManifest();
23182
+ if (componentVersion !== manifest2.version) {
23183
+ throw new error_1.InternalServerError(`manifest version miss match, expected version ${componentVersion} does not equal loaded version ${manifest2.version}`);
23184
+ }
23185
+ if (componentName !== manifest2.name) {
23186
+ throw new error_1.InternalServerError(`manifest name miss match, expected name ${componentVersion} does not equal loaded name ${manifest2.name}`);
23099
23187
  }
23100
23188
  }
23101
- return new LoadedComponent_1.LoadedComponent(manifest, componentFileRoot, componentRootUrl, executor);
23189
+ return component;
23102
23190
  }
23103
23191
  exports.loadComponent = loadComponent;
23104
23192
  async function assertFuncEntryFilesAreValid(componentRoot, manifest, func) {
23105
- if (await isPathTraversing(componentRoot, func.entry) || !await isReadable(componentRoot, func.entry)) {
23193
+ if ((0, isPathTryingToAccessOutsideOfRoot_1.isPathTryingToAccessOutsideOfRoot)(componentRoot, func.entry) || !await isReadable(componentRoot, func.entry)) {
23106
23194
  throw new Error(`access to component "${func.name}'s" entry file "${func.entry}" outside the parent directory in "${manifest.name} ${manifest.version}" is not alllowed`);
23107
23195
  }
23108
23196
  }
@@ -23113,15 +23201,11 @@ var require_loadComponent = __commonJS({
23113
23201
  if (staticFile.file.startsWith("http://") || staticFile.file.startsWith("https://")) {
23114
23202
  continue;
23115
23203
  }
23116
- if (await isPathTraversing(staticFileRoot, staticFile.file) || !await isReadable(staticFileRoot, staticFile.file)) {
23204
+ if ((0, isPathTryingToAccessOutsideOfRoot_1.isPathTryingToAccessOutsideOfRoot)(staticFileRoot, staticFile.file) || !await isReadable(staticFileRoot, staticFile.file)) {
23117
23205
  throw new Error(`access to a static file "${staticFile.file}" for "${func.name}" outside the parent directory in "${manifest.name} ${manifest.version}" is not alllowed`);
23118
23206
  }
23119
23207
  }
23120
23208
  }
23121
- async function isPathTraversing(basePath, file) {
23122
- const filePath = path_1.default.join(basePath, file);
23123
- return !filePath.includes(basePath);
23124
- }
23125
23209
  async function isReadable(basePath, file) {
23126
23210
  try {
23127
23211
  await fs_extra_1.default.access(path_1.default.join(basePath, file), fs_1.constants.R_OK);
@@ -23196,23 +23280,11 @@ var require_requestLogger = __commonJS({
23196
23280
  }
23197
23281
  });
23198
23282
 
23199
- // ../component-lib/node_modules/concat-map/index.js
23200
- var require_concat_map = __commonJS({
23201
- "../component-lib/node_modules/concat-map/index.js"(exports, module2) {
23202
- module2.exports = function(xs, fn) {
23203
- var res = [];
23204
- for (var i = 0; i < xs.length; i++) {
23205
- var x = fn(xs[i], i);
23206
- if (isArray(x))
23207
- res.push.apply(res, x);
23208
- else
23209
- res.push(x);
23210
- }
23211
- return res;
23212
- };
23213
- var isArray = Array.isArray || function(xs) {
23214
- return Object.prototype.toString.call(xs) === "[object Array]";
23215
- };
23283
+ // ../component-lib/node_modules/readdir-glob/node_modules/minimatch/lib/path.js
23284
+ var require_path = __commonJS({
23285
+ "../component-lib/node_modules/readdir-glob/node_modules/minimatch/lib/path.js"(exports, module2) {
23286
+ var isWindows = typeof process === "object" && process && process.platform === "win32";
23287
+ module2.exports = isWindows ? { sep: "\\" } : { sep: "/" };
23216
23288
  }
23217
23289
  });
23218
23290
 
@@ -23276,10 +23348,9 @@ var require_balanced_match = __commonJS({
23276
23348
  }
23277
23349
  });
23278
23350
 
23279
- // ../component-lib/node_modules/brace-expansion/index.js
23351
+ // ../component-lib/node_modules/readdir-glob/node_modules/brace-expansion/index.js
23280
23352
  var require_brace_expansion = __commonJS({
23281
- "../component-lib/node_modules/brace-expansion/index.js"(exports, module2) {
23282
- var concatMap = require_concat_map();
23353
+ "../component-lib/node_modules/readdir-glob/node_modules/brace-expansion/index.js"(exports, module2) {
23283
23354
  var balanced = require_balanced_match();
23284
23355
  module2.exports = expandTop;
23285
23356
  var escSlash = "\0SLASH" + Math.random() + "\0";
@@ -23339,81 +23410,88 @@ var require_brace_expansion = __commonJS({
23339
23410
  function expand(str, isTop) {
23340
23411
  var expansions = [];
23341
23412
  var m = balanced("{", "}", str);
23342
- if (!m || /\$$/.test(m.pre))
23413
+ if (!m)
23343
23414
  return [str];
23344
- var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body);
23345
- var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body);
23346
- var isSequence = isNumericSequence || isAlphaSequence;
23347
- var isOptions = m.body.indexOf(",") >= 0;
23348
- if (!isSequence && !isOptions) {
23349
- if (m.post.match(/,.*\}/)) {
23350
- str = m.pre + "{" + m.body + escClose + m.post;
23351
- return expand(str);
23415
+ var pre = m.pre;
23416
+ var post = m.post.length ? expand(m.post, false) : [""];
23417
+ if (/\$$/.test(m.pre)) {
23418
+ for (var k = 0; k < post.length; k++) {
23419
+ var expansion = pre + "{" + m.body + "}" + post[k];
23420
+ expansions.push(expansion);
23352
23421
  }
23353
- return [str];
23354
- }
23355
- var n;
23356
- if (isSequence) {
23357
- n = m.body.split(/\.\./);
23358
23422
  } else {
23359
- n = parseCommaParts(m.body);
23360
- if (n.length === 1) {
23361
- n = expand(n[0], false).map(embrace);
23423
+ var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body);
23424
+ var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body);
23425
+ var isSequence = isNumericSequence || isAlphaSequence;
23426
+ var isOptions = m.body.indexOf(",") >= 0;
23427
+ if (!isSequence && !isOptions) {
23428
+ if (m.post.match(/,.*\}/)) {
23429
+ str = m.pre + "{" + m.body + escClose + m.post;
23430
+ return expand(str);
23431
+ }
23432
+ return [str];
23433
+ }
23434
+ var n;
23435
+ if (isSequence) {
23436
+ n = m.body.split(/\.\./);
23437
+ } else {
23438
+ n = parseCommaParts(m.body);
23362
23439
  if (n.length === 1) {
23363
- var post = m.post.length ? expand(m.post, false) : [""];
23364
- return post.map(function(p) {
23365
- return m.pre + n[0] + p;
23366
- });
23440
+ n = expand(n[0], false).map(embrace);
23441
+ if (n.length === 1) {
23442
+ return post.map(function(p) {
23443
+ return m.pre + n[0] + p;
23444
+ });
23445
+ }
23367
23446
  }
23368
23447
  }
23369
- }
23370
- var pre = m.pre;
23371
- var post = m.post.length ? expand(m.post, false) : [""];
23372
- var N;
23373
- if (isSequence) {
23374
- var x = numeric(n[0]);
23375
- var y = numeric(n[1]);
23376
- var width = Math.max(n[0].length, n[1].length);
23377
- var incr = n.length == 3 ? Math.abs(numeric(n[2])) : 1;
23378
- var test = lte;
23379
- var reverse = y < x;
23380
- if (reverse) {
23381
- incr *= -1;
23382
- test = gte;
23383
- }
23384
- var pad = n.some(isPadded);
23385
- N = [];
23386
- for (var i = x; test(i, y); i += incr) {
23387
- var c;
23388
- if (isAlphaSequence) {
23389
- c = String.fromCharCode(i);
23390
- if (c === "\\")
23391
- c = "";
23392
- } else {
23393
- c = String(i);
23394
- if (pad) {
23395
- var need = width - c.length;
23396
- if (need > 0) {
23397
- var z = new Array(need + 1).join("0");
23398
- if (i < 0)
23399
- c = "-" + z + c.slice(1);
23400
- else
23401
- c = z + c;
23448
+ var N;
23449
+ if (isSequence) {
23450
+ var x = numeric(n[0]);
23451
+ var y = numeric(n[1]);
23452
+ var width = Math.max(n[0].length, n[1].length);
23453
+ var incr = n.length == 3 ? Math.abs(numeric(n[2])) : 1;
23454
+ var test = lte;
23455
+ var reverse = y < x;
23456
+ if (reverse) {
23457
+ incr *= -1;
23458
+ test = gte;
23459
+ }
23460
+ var pad = n.some(isPadded);
23461
+ N = [];
23462
+ for (var i = x; test(i, y); i += incr) {
23463
+ var c;
23464
+ if (isAlphaSequence) {
23465
+ c = String.fromCharCode(i);
23466
+ if (c === "\\")
23467
+ c = "";
23468
+ } else {
23469
+ c = String(i);
23470
+ if (pad) {
23471
+ var need = width - c.length;
23472
+ if (need > 0) {
23473
+ var z = new Array(need + 1).join("0");
23474
+ if (i < 0)
23475
+ c = "-" + z + c.slice(1);
23476
+ else
23477
+ c = z + c;
23478
+ }
23402
23479
  }
23403
23480
  }
23481
+ N.push(c);
23482
+ }
23483
+ } else {
23484
+ N = [];
23485
+ for (var j = 0; j < n.length; j++) {
23486
+ N.push.apply(N, expand(n[j], false));
23404
23487
  }
23405
- N.push(c);
23406
23488
  }
23407
- } else {
23408
- N = concatMap(n, function(el) {
23409
- return expand(el, false);
23410
- });
23411
- }
23412
- for (var j = 0; j < N.length; j++) {
23413
- for (var k = 0; k < post.length; k++) {
23414
- var expansion = pre + N[j] + post[k];
23415
- if (!isTop || isSequence || expansion)
23416
- expansions.push(expansion);
23489
+ for (var j = 0; j < N.length; j++) {
23490
+ for (var k = 0; k < post.length; k++) {
23491
+ var expansion = pre + N[j] + post[k];
23492
+ if (!isTop || isSequence || expansion)
23493
+ expansions.push(expansion);
23494
+ }
23417
23495
  }
23418
23496
  }
23419
23497
  return expansions;
@@ -23421,21 +23499,21 @@ var require_brace_expansion = __commonJS({
23421
23499
  }
23422
23500
  });
23423
23501
 
23424
- // ../component-lib/node_modules/minimatch/minimatch.js
23502
+ // ../component-lib/node_modules/readdir-glob/node_modules/minimatch/minimatch.js
23425
23503
  var require_minimatch = __commonJS({
23426
- "../component-lib/node_modules/minimatch/minimatch.js"(exports, module2) {
23427
- module2.exports = minimatch;
23428
- minimatch.Minimatch = Minimatch;
23429
- var path = function() {
23430
- try {
23431
- return require("path");
23432
- } catch (e) {
23504
+ "../component-lib/node_modules/readdir-glob/node_modules/minimatch/minimatch.js"(exports, module2) {
23505
+ var minimatch = module2.exports = (p, pattern, options = {}) => {
23506
+ assertValidPattern(pattern);
23507
+ if (!options.nocomment && pattern.charAt(0) === "#") {
23508
+ return false;
23433
23509
  }
23434
- }() || {
23435
- sep: "/"
23510
+ return new Minimatch(pattern, options).match(p);
23436
23511
  };
23512
+ module2.exports = minimatch;
23513
+ var path = require_path();
23437
23514
  minimatch.sep = path.sep;
23438
- var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {};
23515
+ var GLOBSTAR = Symbol("globstar **");
23516
+ minimatch.GLOBSTAR = GLOBSTAR;
23439
23517
  var expand = require_brace_expansion();
23440
23518
  var plTypes = {
23441
23519
  "!": { open: "(?:(?!(?:", close: "))[^/]*?)" },
@@ -23448,168 +23526,49 @@ var require_minimatch = __commonJS({
23448
23526
  var star = qmark + "*?";
23449
23527
  var twoStarDot = "(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?";
23450
23528
  var twoStarNoDot = "(?:(?!(?:\\/|^)\\.).)*?";
23529
+ var charSet = (s) => s.split("").reduce((set, c) => {
23530
+ set[c] = true;
23531
+ return set;
23532
+ }, {});
23451
23533
  var reSpecials = charSet("().*{}+?[]^$\\!");
23452
- function charSet(s) {
23453
- return s.split("").reduce(function(set, c) {
23454
- set[c] = true;
23455
- return set;
23456
- }, {});
23457
- }
23534
+ var addPatternStartSet = charSet("[.(");
23458
23535
  var slashSplit = /\/+/;
23459
- minimatch.filter = filter;
23460
- function filter(pattern, options) {
23461
- options = options || {};
23462
- return function(p, i, list) {
23463
- return minimatch(p, pattern, options);
23464
- };
23465
- }
23466
- function ext(a, b) {
23467
- b = b || {};
23468
- var t = {};
23469
- Object.keys(a).forEach(function(k) {
23470
- t[k] = a[k];
23471
- });
23472
- Object.keys(b).forEach(function(k) {
23473
- t[k] = b[k];
23474
- });
23536
+ minimatch.filter = (pattern, options = {}) => (p, i, list) => minimatch(p, pattern, options);
23537
+ var ext = (a, b = {}) => {
23538
+ const t = {};
23539
+ Object.keys(a).forEach((k) => t[k] = a[k]);
23540
+ Object.keys(b).forEach((k) => t[k] = b[k]);
23475
23541
  return t;
23476
- }
23477
- minimatch.defaults = function(def) {
23542
+ };
23543
+ minimatch.defaults = (def) => {
23478
23544
  if (!def || typeof def !== "object" || !Object.keys(def).length) {
23479
23545
  return minimatch;
23480
23546
  }
23481
- var orig = minimatch;
23482
- var m = function minimatch2(p, pattern, options) {
23483
- return orig(p, pattern, ext(def, options));
23484
- };
23485
- m.Minimatch = function Minimatch2(pattern, options) {
23486
- return new orig.Minimatch(pattern, ext(def, options));
23487
- };
23488
- m.Minimatch.defaults = function defaults(options) {
23489
- return orig.defaults(ext(def, options)).Minimatch;
23490
- };
23491
- m.filter = function filter2(pattern, options) {
23492
- return orig.filter(pattern, ext(def, options));
23493
- };
23494
- m.defaults = function defaults(options) {
23495
- return orig.defaults(ext(def, options));
23496
- };
23497
- m.makeRe = function makeRe2(pattern, options) {
23498
- return orig.makeRe(pattern, ext(def, options));
23499
- };
23500
- m.braceExpand = function braceExpand2(pattern, options) {
23501
- return orig.braceExpand(pattern, ext(def, options));
23502
- };
23503
- m.match = function(list, pattern, options) {
23504
- return orig.match(list, pattern, ext(def, options));
23547
+ const orig = minimatch;
23548
+ const m = (p, pattern, options) => orig(p, pattern, ext(def, options));
23549
+ m.Minimatch = class Minimatch extends orig.Minimatch {
23550
+ constructor(pattern, options) {
23551
+ super(pattern, ext(def, options));
23552
+ }
23505
23553
  };
23554
+ m.Minimatch.defaults = (options) => orig.defaults(ext(def, options)).Minimatch;
23555
+ m.filter = (pattern, options) => orig.filter(pattern, ext(def, options));
23556
+ m.defaults = (options) => orig.defaults(ext(def, options));
23557
+ m.makeRe = (pattern, options) => orig.makeRe(pattern, ext(def, options));
23558
+ m.braceExpand = (pattern, options) => orig.braceExpand(pattern, ext(def, options));
23559
+ m.match = (list, pattern, options) => orig.match(list, pattern, ext(def, options));
23506
23560
  return m;
23507
23561
  };
23508
- Minimatch.defaults = function(def) {
23509
- return minimatch.defaults(def).Minimatch;
23510
- };
23511
- function minimatch(p, pattern, options) {
23512
- assertValidPattern(pattern);
23513
- if (!options)
23514
- options = {};
23515
- if (!options.nocomment && pattern.charAt(0) === "#") {
23516
- return false;
23517
- }
23518
- return new Minimatch(pattern, options).match(p);
23519
- }
23520
- function Minimatch(pattern, options) {
23521
- if (!(this instanceof Minimatch)) {
23522
- return new Minimatch(pattern, options);
23523
- }
23524
- assertValidPattern(pattern);
23525
- if (!options)
23526
- options = {};
23527
- pattern = pattern.trim();
23528
- if (!options.allowWindowsEscape && path.sep !== "/") {
23529
- pattern = pattern.split(path.sep).join("/");
23530
- }
23531
- this.options = options;
23532
- this.set = [];
23533
- this.pattern = pattern;
23534
- this.regexp = null;
23535
- this.negate = false;
23536
- this.comment = false;
23537
- this.empty = false;
23538
- this.partial = !!options.partial;
23539
- this.make();
23540
- }
23541
- Minimatch.prototype.debug = function() {
23542
- };
23543
- Minimatch.prototype.make = make;
23544
- function make() {
23545
- var pattern = this.pattern;
23546
- var options = this.options;
23547
- if (!options.nocomment && pattern.charAt(0) === "#") {
23548
- this.comment = true;
23549
- return;
23550
- }
23551
- if (!pattern) {
23552
- this.empty = true;
23553
- return;
23554
- }
23555
- this.parseNegate();
23556
- var set = this.globSet = this.braceExpand();
23557
- if (options.debug)
23558
- this.debug = function debug() {
23559
- console.error.apply(console, arguments);
23560
- };
23561
- this.debug(this.pattern, set);
23562
- set = this.globParts = set.map(function(s) {
23563
- return s.split(slashSplit);
23564
- });
23565
- this.debug(this.pattern, set);
23566
- set = set.map(function(s, si, set2) {
23567
- return s.map(this.parse, this);
23568
- }, this);
23569
- this.debug(this.pattern, set);
23570
- set = set.filter(function(s) {
23571
- return s.indexOf(false) === -1;
23572
- });
23573
- this.debug(this.pattern, set);
23574
- this.set = set;
23575
- }
23576
- Minimatch.prototype.parseNegate = parseNegate;
23577
- function parseNegate() {
23578
- var pattern = this.pattern;
23579
- var negate = false;
23580
- var options = this.options;
23581
- var negateOffset = 0;
23582
- if (options.nonegate)
23583
- return;
23584
- for (var i = 0, l = pattern.length; i < l && pattern.charAt(i) === "!"; i++) {
23585
- negate = !negate;
23586
- negateOffset++;
23587
- }
23588
- if (negateOffset)
23589
- this.pattern = pattern.substr(negateOffset);
23590
- this.negate = negate;
23591
- }
23592
- minimatch.braceExpand = function(pattern, options) {
23593
- return braceExpand(pattern, options);
23594
- };
23595
- Minimatch.prototype.braceExpand = braceExpand;
23596
- function braceExpand(pattern, options) {
23597
- if (!options) {
23598
- if (this instanceof Minimatch) {
23599
- options = this.options;
23600
- } else {
23601
- options = {};
23602
- }
23603
- }
23604
- pattern = typeof pattern === "undefined" ? this.pattern : pattern;
23562
+ minimatch.braceExpand = (pattern, options) => braceExpand(pattern, options);
23563
+ var braceExpand = (pattern, options = {}) => {
23605
23564
  assertValidPattern(pattern);
23606
23565
  if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) {
23607
23566
  return [pattern];
23608
23567
  }
23609
23568
  return expand(pattern);
23610
- }
23569
+ };
23611
23570
  var MAX_PATTERN_LENGTH = 1024 * 64;
23612
- var assertValidPattern = function(pattern) {
23571
+ var assertValidPattern = (pattern) => {
23613
23572
  if (typeof pattern !== "string") {
23614
23573
  throw new TypeError("invalid pattern");
23615
23574
  }
@@ -23617,394 +23576,463 @@ var require_minimatch = __commonJS({
23617
23576
  throw new TypeError("pattern is too long");
23618
23577
  }
23619
23578
  };
23620
- Minimatch.prototype.parse = parse;
23621
- var SUBPARSE = {};
23622
- function parse(pattern, isSub) {
23623
- assertValidPattern(pattern);
23624
- var options = this.options;
23625
- if (pattern === "**") {
23626
- if (!options.noglobstar)
23627
- return GLOBSTAR;
23628
- else
23629
- pattern = "*";
23579
+ var SUBPARSE = Symbol("subparse");
23580
+ minimatch.makeRe = (pattern, options) => new Minimatch(pattern, options || {}).makeRe();
23581
+ minimatch.match = (list, pattern, options = {}) => {
23582
+ const mm = new Minimatch(pattern, options);
23583
+ list = list.filter((f) => mm.match(f));
23584
+ if (mm.options.nonull && !list.length) {
23585
+ list.push(pattern);
23630
23586
  }
23631
- if (pattern === "")
23632
- return "";
23633
- var re = "";
23634
- var hasMagic = !!options.nocase;
23635
- var escaping = false;
23636
- var patternListStack = [];
23637
- var negativeLists = [];
23638
- var stateChar;
23639
- var inClass = false;
23640
- var reClassStart = -1;
23641
- var classStart = -1;
23642
- var patternStart = pattern.charAt(0) === "." ? "" : options.dot ? "(?!(?:^|\\/)\\.{1,2}(?:$|\\/))" : "(?!\\.)";
23643
- var self2 = this;
23644
- function clearStateChar() {
23645
- if (stateChar) {
23646
- switch (stateChar) {
23647
- case "*":
23648
- re += star;
23649
- hasMagic = true;
23650
- break;
23651
- case "?":
23652
- re += qmark;
23653
- hasMagic = true;
23654
- break;
23655
- default:
23656
- re += "\\" + stateChar;
23657
- break;
23658
- }
23659
- self2.debug("clearStateChar %j %j", stateChar, re);
23660
- stateChar = false;
23587
+ return list;
23588
+ };
23589
+ var globUnescape = (s) => s.replace(/\\(.)/g, "$1");
23590
+ var regExpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
23591
+ var Minimatch = class {
23592
+ constructor(pattern, options) {
23593
+ assertValidPattern(pattern);
23594
+ if (!options)
23595
+ options = {};
23596
+ this.options = options;
23597
+ this.set = [];
23598
+ this.pattern = pattern;
23599
+ this.windowsPathsNoEscape = !!options.windowsPathsNoEscape || options.allowWindowsEscape === false;
23600
+ if (this.windowsPathsNoEscape) {
23601
+ this.pattern = this.pattern.replace(/\\/g, "/");
23602
+ }
23603
+ this.regexp = null;
23604
+ this.negate = false;
23605
+ this.comment = false;
23606
+ this.empty = false;
23607
+ this.partial = !!options.partial;
23608
+ this.make();
23609
+ }
23610
+ debug() {
23611
+ }
23612
+ make() {
23613
+ const pattern = this.pattern;
23614
+ const options = this.options;
23615
+ if (!options.nocomment && pattern.charAt(0) === "#") {
23616
+ this.comment = true;
23617
+ return;
23661
23618
  }
23662
- }
23663
- for (var i = 0, len = pattern.length, c; i < len && (c = pattern.charAt(i)); i++) {
23664
- this.debug("%s %s %s %j", pattern, i, re, c);
23665
- if (escaping && reSpecials[c]) {
23666
- re += "\\" + c;
23667
- escaping = false;
23668
- continue;
23619
+ if (!pattern) {
23620
+ this.empty = true;
23621
+ return;
23669
23622
  }
23670
- switch (c) {
23671
- case "/": {
23623
+ this.parseNegate();
23624
+ let set = this.globSet = this.braceExpand();
23625
+ if (options.debug)
23626
+ this.debug = (...args) => console.error(...args);
23627
+ this.debug(this.pattern, set);
23628
+ set = this.globParts = set.map((s) => s.split(slashSplit));
23629
+ this.debug(this.pattern, set);
23630
+ set = set.map((s, si, set2) => s.map(this.parse, this));
23631
+ this.debug(this.pattern, set);
23632
+ set = set.filter((s) => s.indexOf(false) === -1);
23633
+ this.debug(this.pattern, set);
23634
+ this.set = set;
23635
+ }
23636
+ parseNegate() {
23637
+ if (this.options.nonegate)
23638
+ return;
23639
+ const pattern = this.pattern;
23640
+ let negate = false;
23641
+ let negateOffset = 0;
23642
+ for (let i = 0; i < pattern.length && pattern.charAt(i) === "!"; i++) {
23643
+ negate = !negate;
23644
+ negateOffset++;
23645
+ }
23646
+ if (negateOffset)
23647
+ this.pattern = pattern.substr(negateOffset);
23648
+ this.negate = negate;
23649
+ }
23650
+ matchOne(file, pattern, partial) {
23651
+ var options = this.options;
23652
+ this.debug("matchOne", { "this": this, file, pattern });
23653
+ this.debug("matchOne", file.length, pattern.length);
23654
+ for (var fi = 0, pi = 0, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {
23655
+ this.debug("matchOne loop");
23656
+ var p = pattern[pi];
23657
+ var f = file[fi];
23658
+ this.debug(pattern, p, f);
23659
+ if (p === false)
23672
23660
  return false;
23673
- }
23674
- case "\\":
23675
- clearStateChar();
23676
- escaping = true;
23677
- continue;
23678
- case "?":
23679
- case "*":
23680
- case "+":
23681
- case "@":
23682
- case "!":
23683
- this.debug("%s %s %s %j <-- stateChar", pattern, i, re, c);
23684
- if (inClass) {
23685
- this.debug(" in class");
23686
- if (c === "!" && i === classStart + 1)
23687
- c = "^";
23688
- re += c;
23689
- continue;
23661
+ if (p === GLOBSTAR) {
23662
+ this.debug("GLOBSTAR", [pattern, p, f]);
23663
+ var fr = fi;
23664
+ var pr = pi + 1;
23665
+ if (pr === pl) {
23666
+ this.debug("** at the end");
23667
+ for (; fi < fl; fi++) {
23668
+ if (file[fi] === "." || file[fi] === ".." || !options.dot && file[fi].charAt(0) === ".")
23669
+ return false;
23670
+ }
23671
+ return true;
23690
23672
  }
23691
- self2.debug("call clearStateChar %j", stateChar);
23692
- clearStateChar();
23693
- stateChar = c;
23694
- if (options.noext)
23695
- clearStateChar();
23696
- continue;
23697
- case "(":
23698
- if (inClass) {
23699
- re += "(";
23700
- continue;
23673
+ while (fr < fl) {
23674
+ var swallowee = file[fr];
23675
+ this.debug("\nglobstar while", file, fr, pattern, pr, swallowee);
23676
+ if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {
23677
+ this.debug("globstar found match!", fr, fl, swallowee);
23678
+ return true;
23679
+ } else {
23680
+ if (swallowee === "." || swallowee === ".." || !options.dot && swallowee.charAt(0) === ".") {
23681
+ this.debug("dot detected!", file, fr, pattern, pr);
23682
+ break;
23683
+ }
23684
+ this.debug("globstar swallow a segment, and continue");
23685
+ fr++;
23686
+ }
23701
23687
  }
23702
- if (!stateChar) {
23703
- re += "\\(";
23704
- continue;
23688
+ if (partial) {
23689
+ this.debug("\n>>> no match, partial?", file, fr, pattern, pr);
23690
+ if (fr === fl)
23691
+ return true;
23705
23692
  }
23706
- patternListStack.push({
23707
- type: stateChar,
23708
- start: i - 1,
23709
- reStart: re.length,
23710
- open: plTypes[stateChar].open,
23711
- close: plTypes[stateChar].close
23712
- });
23713
- re += stateChar === "!" ? "(?:(?!(?:" : "(?:";
23714
- this.debug("plType %j %j", stateChar, re);
23693
+ return false;
23694
+ }
23695
+ var hit;
23696
+ if (typeof p === "string") {
23697
+ hit = f === p;
23698
+ this.debug("string match", p, f, hit);
23699
+ } else {
23700
+ hit = f.match(p);
23701
+ this.debug("pattern match", p, f, hit);
23702
+ }
23703
+ if (!hit)
23704
+ return false;
23705
+ }
23706
+ if (fi === fl && pi === pl) {
23707
+ return true;
23708
+ } else if (fi === fl) {
23709
+ return partial;
23710
+ } else if (pi === pl) {
23711
+ return fi === fl - 1 && file[fi] === "";
23712
+ }
23713
+ throw new Error("wtf?");
23714
+ }
23715
+ braceExpand() {
23716
+ return braceExpand(this.pattern, this.options);
23717
+ }
23718
+ parse(pattern, isSub) {
23719
+ assertValidPattern(pattern);
23720
+ const options = this.options;
23721
+ if (pattern === "**") {
23722
+ if (!options.noglobstar)
23723
+ return GLOBSTAR;
23724
+ else
23725
+ pattern = "*";
23726
+ }
23727
+ if (pattern === "")
23728
+ return "";
23729
+ let re = "";
23730
+ let hasMagic = !!options.nocase;
23731
+ let escaping = false;
23732
+ const patternListStack = [];
23733
+ const negativeLists = [];
23734
+ let stateChar;
23735
+ let inClass = false;
23736
+ let reClassStart = -1;
23737
+ let classStart = -1;
23738
+ let cs;
23739
+ let pl;
23740
+ let sp;
23741
+ const patternStart = pattern.charAt(0) === "." ? "" : options.dot ? "(?!(?:^|\\/)\\.{1,2}(?:$|\\/))" : "(?!\\.)";
23742
+ const clearStateChar = () => {
23743
+ if (stateChar) {
23744
+ switch (stateChar) {
23745
+ case "*":
23746
+ re += star;
23747
+ hasMagic = true;
23748
+ break;
23749
+ case "?":
23750
+ re += qmark;
23751
+ hasMagic = true;
23752
+ break;
23753
+ default:
23754
+ re += "\\" + stateChar;
23755
+ break;
23756
+ }
23757
+ this.debug("clearStateChar %j %j", stateChar, re);
23715
23758
  stateChar = false;
23716
- continue;
23717
- case ")":
23718
- if (inClass || !patternListStack.length) {
23719
- re += "\\)";
23720
- continue;
23759
+ }
23760
+ };
23761
+ for (let i = 0, c; i < pattern.length && (c = pattern.charAt(i)); i++) {
23762
+ this.debug("%s %s %s %j", pattern, i, re, c);
23763
+ if (escaping) {
23764
+ if (c === "/") {
23765
+ return false;
23721
23766
  }
23722
- clearStateChar();
23723
- hasMagic = true;
23724
- var pl = patternListStack.pop();
23725
- re += pl.close;
23726
- if (pl.type === "!") {
23727
- negativeLists.push(pl);
23767
+ if (reSpecials[c]) {
23768
+ re += "\\";
23728
23769
  }
23729
- pl.reEnd = re.length;
23770
+ re += c;
23771
+ escaping = false;
23730
23772
  continue;
23731
- case "|":
23732
- if (inClass || !patternListStack.length || escaping) {
23733
- re += "\\|";
23734
- escaping = false;
23735
- continue;
23773
+ }
23774
+ switch (c) {
23775
+ case "/": {
23776
+ return false;
23736
23777
  }
23737
- clearStateChar();
23738
- re += "|";
23739
- continue;
23740
- case "[":
23741
- clearStateChar();
23742
- if (inClass) {
23743
- re += "\\" + c;
23778
+ case "\\":
23779
+ clearStateChar();
23780
+ escaping = true;
23744
23781
  continue;
23745
- }
23746
- inClass = true;
23747
- classStart = i;
23748
- reClassStart = re.length;
23749
- re += c;
23750
- continue;
23751
- case "]":
23752
- if (i === classStart + 1 || !inClass) {
23753
- re += "\\" + c;
23754
- escaping = false;
23782
+ case "?":
23783
+ case "*":
23784
+ case "+":
23785
+ case "@":
23786
+ case "!":
23787
+ this.debug("%s %s %s %j <-- stateChar", pattern, i, re, c);
23788
+ if (inClass) {
23789
+ this.debug(" in class");
23790
+ if (c === "!" && i === classStart + 1)
23791
+ c = "^";
23792
+ re += c;
23793
+ continue;
23794
+ }
23795
+ this.debug("call clearStateChar %j", stateChar);
23796
+ clearStateChar();
23797
+ stateChar = c;
23798
+ if (options.noext)
23799
+ clearStateChar();
23755
23800
  continue;
23756
- }
23757
- var cs = pattern.substring(classStart + 1, i);
23758
- try {
23759
- RegExp("[" + cs + "]");
23760
- } catch (er) {
23761
- var sp = this.parse(cs, SUBPARSE);
23762
- re = re.substr(0, reClassStart) + "\\[" + sp[0] + "\\]";
23763
- hasMagic = hasMagic || sp[1];
23801
+ case "(":
23802
+ if (inClass) {
23803
+ re += "(";
23804
+ continue;
23805
+ }
23806
+ if (!stateChar) {
23807
+ re += "\\(";
23808
+ continue;
23809
+ }
23810
+ patternListStack.push({
23811
+ type: stateChar,
23812
+ start: i - 1,
23813
+ reStart: re.length,
23814
+ open: plTypes[stateChar].open,
23815
+ close: plTypes[stateChar].close
23816
+ });
23817
+ re += stateChar === "!" ? "(?:(?!(?:" : "(?:";
23818
+ this.debug("plType %j %j", stateChar, re);
23819
+ stateChar = false;
23820
+ continue;
23821
+ case ")":
23822
+ if (inClass || !patternListStack.length) {
23823
+ re += "\\)";
23824
+ continue;
23825
+ }
23826
+ clearStateChar();
23827
+ hasMagic = true;
23828
+ pl = patternListStack.pop();
23829
+ re += pl.close;
23830
+ if (pl.type === "!") {
23831
+ negativeLists.push(pl);
23832
+ }
23833
+ pl.reEnd = re.length;
23834
+ continue;
23835
+ case "|":
23836
+ if (inClass || !patternListStack.length) {
23837
+ re += "\\|";
23838
+ continue;
23839
+ }
23840
+ clearStateChar();
23841
+ re += "|";
23842
+ continue;
23843
+ case "[":
23844
+ clearStateChar();
23845
+ if (inClass) {
23846
+ re += "\\" + c;
23847
+ continue;
23848
+ }
23849
+ inClass = true;
23850
+ classStart = i;
23851
+ reClassStart = re.length;
23852
+ re += c;
23853
+ continue;
23854
+ case "]":
23855
+ if (i === classStart + 1 || !inClass) {
23856
+ re += "\\" + c;
23857
+ continue;
23858
+ }
23859
+ cs = pattern.substring(classStart + 1, i);
23860
+ try {
23861
+ RegExp("[" + cs + "]");
23862
+ } catch (er) {
23863
+ sp = this.parse(cs, SUBPARSE);
23864
+ re = re.substr(0, reClassStart) + "\\[" + sp[0] + "\\]";
23865
+ hasMagic = hasMagic || sp[1];
23866
+ inClass = false;
23867
+ continue;
23868
+ }
23869
+ hasMagic = true;
23764
23870
  inClass = false;
23871
+ re += c;
23765
23872
  continue;
23873
+ default:
23874
+ clearStateChar();
23875
+ if (reSpecials[c] && !(c === "^" && inClass)) {
23876
+ re += "\\";
23877
+ }
23878
+ re += c;
23879
+ break;
23880
+ }
23881
+ }
23882
+ if (inClass) {
23883
+ cs = pattern.substr(classStart + 1);
23884
+ sp = this.parse(cs, SUBPARSE);
23885
+ re = re.substr(0, reClassStart) + "\\[" + sp[0];
23886
+ hasMagic = hasMagic || sp[1];
23887
+ }
23888
+ for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) {
23889
+ let tail;
23890
+ tail = re.slice(pl.reStart + pl.open.length);
23891
+ this.debug("setting tail", re, pl);
23892
+ tail = tail.replace(/((?:\\{2}){0,64})(\\?)\|/g, (_2, $1, $2) => {
23893
+ if (!$2) {
23894
+ $2 = "\\";
23766
23895
  }
23767
- hasMagic = true;
23768
- inClass = false;
23769
- re += c;
23770
- continue;
23771
- default:
23772
- clearStateChar();
23773
- if (escaping) {
23774
- escaping = false;
23775
- } else if (reSpecials[c] && !(c === "^" && inClass)) {
23776
- re += "\\";
23896
+ return $1 + $1 + $2 + "|";
23897
+ });
23898
+ this.debug("tail=%j\n %s", tail, tail, pl, re);
23899
+ const t = pl.type === "*" ? star : pl.type === "?" ? qmark : "\\" + pl.type;
23900
+ hasMagic = true;
23901
+ re = re.slice(0, pl.reStart) + t + "\\(" + tail;
23902
+ }
23903
+ clearStateChar();
23904
+ if (escaping) {
23905
+ re += "\\\\";
23906
+ }
23907
+ const addPatternStart = addPatternStartSet[re.charAt(0)];
23908
+ for (let n = negativeLists.length - 1; n > -1; n--) {
23909
+ const nl = negativeLists[n];
23910
+ const nlBefore = re.slice(0, nl.reStart);
23911
+ const nlFirst = re.slice(nl.reStart, nl.reEnd - 8);
23912
+ let nlAfter = re.slice(nl.reEnd);
23913
+ const nlLast = re.slice(nl.reEnd - 8, nl.reEnd) + nlAfter;
23914
+ const openParensBefore = nlBefore.split("(").length - 1;
23915
+ let cleanAfter = nlAfter;
23916
+ for (let i = 0; i < openParensBefore; i++) {
23917
+ cleanAfter = cleanAfter.replace(/\)[+*?]?/, "");
23918
+ }
23919
+ nlAfter = cleanAfter;
23920
+ const dollar = nlAfter === "" && isSub !== SUBPARSE ? "$" : "";
23921
+ re = nlBefore + nlFirst + nlAfter + dollar + nlLast;
23922
+ }
23923
+ if (re !== "" && hasMagic) {
23924
+ re = "(?=.)" + re;
23925
+ }
23926
+ if (addPatternStart) {
23927
+ re = patternStart + re;
23928
+ }
23929
+ if (isSub === SUBPARSE) {
23930
+ return [re, hasMagic];
23931
+ }
23932
+ if (!hasMagic) {
23933
+ return globUnescape(pattern);
23934
+ }
23935
+ const flags = options.nocase ? "i" : "";
23936
+ try {
23937
+ return Object.assign(new RegExp("^" + re + "$", flags), {
23938
+ _glob: pattern,
23939
+ _src: re
23940
+ });
23941
+ } catch (er) {
23942
+ return new RegExp("$.");
23943
+ }
23944
+ }
23945
+ makeRe() {
23946
+ if (this.regexp || this.regexp === false)
23947
+ return this.regexp;
23948
+ const set = this.set;
23949
+ if (!set.length) {
23950
+ this.regexp = false;
23951
+ return this.regexp;
23952
+ }
23953
+ const options = this.options;
23954
+ const twoStar = options.noglobstar ? star : options.dot ? twoStarDot : twoStarNoDot;
23955
+ const flags = options.nocase ? "i" : "";
23956
+ let re = set.map((pattern) => {
23957
+ pattern = pattern.map((p) => typeof p === "string" ? regExpEscape(p) : p === GLOBSTAR ? GLOBSTAR : p._src).reduce((set2, p) => {
23958
+ if (!(set2[set2.length - 1] === GLOBSTAR && p === GLOBSTAR)) {
23959
+ set2.push(p);
23960
+ }
23961
+ return set2;
23962
+ }, []);
23963
+ pattern.forEach((p, i) => {
23964
+ if (p !== GLOBSTAR || pattern[i - 1] === GLOBSTAR) {
23965
+ return;
23777
23966
  }
23778
- re += c;
23779
- }
23780
- }
23781
- if (inClass) {
23782
- cs = pattern.substr(classStart + 1);
23783
- sp = this.parse(cs, SUBPARSE);
23784
- re = re.substr(0, reClassStart) + "\\[" + sp[0];
23785
- hasMagic = hasMagic || sp[1];
23786
- }
23787
- for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) {
23788
- var tail = re.slice(pl.reStart + pl.open.length);
23789
- this.debug("setting tail", re, pl);
23790
- tail = tail.replace(/((?:\\{2}){0,64})(\\?)\|/g, function(_2, $1, $2) {
23791
- if (!$2) {
23792
- $2 = "\\";
23793
- }
23794
- return $1 + $1 + $2 + "|";
23795
- });
23796
- this.debug("tail=%j\n %s", tail, tail, pl, re);
23797
- var t = pl.type === "*" ? star : pl.type === "?" ? qmark : "\\" + pl.type;
23798
- hasMagic = true;
23799
- re = re.slice(0, pl.reStart) + t + "\\(" + tail;
23800
- }
23801
- clearStateChar();
23802
- if (escaping) {
23803
- re += "\\\\";
23804
- }
23805
- var addPatternStart = false;
23806
- switch (re.charAt(0)) {
23807
- case "[":
23808
- case ".":
23809
- case "(":
23810
- addPatternStart = true;
23811
- }
23812
- for (var n = negativeLists.length - 1; n > -1; n--) {
23813
- var nl = negativeLists[n];
23814
- var nlBefore = re.slice(0, nl.reStart);
23815
- var nlFirst = re.slice(nl.reStart, nl.reEnd - 8);
23816
- var nlLast = re.slice(nl.reEnd - 8, nl.reEnd);
23817
- var nlAfter = re.slice(nl.reEnd);
23818
- nlLast += nlAfter;
23819
- var openParensBefore = nlBefore.split("(").length - 1;
23820
- var cleanAfter = nlAfter;
23821
- for (i = 0; i < openParensBefore; i++) {
23822
- cleanAfter = cleanAfter.replace(/\)[+*?]?/, "");
23823
- }
23824
- nlAfter = cleanAfter;
23825
- var dollar = "";
23826
- if (nlAfter === "" && isSub !== SUBPARSE) {
23827
- dollar = "$";
23967
+ if (i === 0) {
23968
+ if (pattern.length > 1) {
23969
+ pattern[i + 1] = "(?:\\/|" + twoStar + "\\/)?" + pattern[i + 1];
23970
+ } else {
23971
+ pattern[i] = twoStar;
23972
+ }
23973
+ } else if (i === pattern.length - 1) {
23974
+ pattern[i - 1] += "(?:\\/|" + twoStar + ")?";
23975
+ } else {
23976
+ pattern[i - 1] += "(?:\\/|\\/" + twoStar + "\\/)" + pattern[i + 1];
23977
+ pattern[i + 1] = GLOBSTAR;
23978
+ }
23979
+ });
23980
+ return pattern.filter((p) => p !== GLOBSTAR).join("/");
23981
+ }).join("|");
23982
+ re = "^(?:" + re + ")$";
23983
+ if (this.negate)
23984
+ re = "^(?!" + re + ").*$";
23985
+ try {
23986
+ this.regexp = new RegExp(re, flags);
23987
+ } catch (ex) {
23988
+ this.regexp = false;
23828
23989
  }
23829
- var newRe = nlBefore + nlFirst + nlAfter + dollar + nlLast;
23830
- re = newRe;
23831
- }
23832
- if (re !== "" && hasMagic) {
23833
- re = "(?=.)" + re;
23834
- }
23835
- if (addPatternStart) {
23836
- re = patternStart + re;
23837
- }
23838
- if (isSub === SUBPARSE) {
23839
- return [re, hasMagic];
23840
- }
23841
- if (!hasMagic) {
23842
- return globUnescape(pattern);
23843
- }
23844
- var flags = options.nocase ? "i" : "";
23845
- try {
23846
- var regExp = new RegExp("^" + re + "$", flags);
23847
- } catch (er) {
23848
- return new RegExp("$.");
23849
- }
23850
- regExp._glob = pattern;
23851
- regExp._src = re;
23852
- return regExp;
23853
- }
23854
- minimatch.makeRe = function(pattern, options) {
23855
- return new Minimatch(pattern, options || {}).makeRe();
23856
- };
23857
- Minimatch.prototype.makeRe = makeRe;
23858
- function makeRe() {
23859
- if (this.regexp || this.regexp === false)
23860
- return this.regexp;
23861
- var set = this.set;
23862
- if (!set.length) {
23863
- this.regexp = false;
23864
23990
  return this.regexp;
23865
23991
  }
23866
- var options = this.options;
23867
- var twoStar = options.noglobstar ? star : options.dot ? twoStarDot : twoStarNoDot;
23868
- var flags = options.nocase ? "i" : "";
23869
- var re = set.map(function(pattern) {
23870
- return pattern.map(function(p) {
23871
- return p === GLOBSTAR ? twoStar : typeof p === "string" ? regExpEscape(p) : p._src;
23872
- }).join("\\/");
23873
- }).join("|");
23874
- re = "^(?:" + re + ")$";
23875
- if (this.negate)
23876
- re = "^(?!" + re + ").*$";
23877
- try {
23878
- this.regexp = new RegExp(re, flags);
23879
- } catch (ex) {
23880
- this.regexp = false;
23881
- }
23882
- return this.regexp;
23883
- }
23884
- minimatch.match = function(list, pattern, options) {
23885
- options = options || {};
23886
- var mm = new Minimatch(pattern, options);
23887
- list = list.filter(function(f) {
23888
- return mm.match(f);
23889
- });
23890
- if (mm.options.nonull && !list.length) {
23891
- list.push(pattern);
23892
- }
23893
- return list;
23894
- };
23895
- Minimatch.prototype.match = function match(f, partial) {
23896
- if (typeof partial === "undefined")
23897
- partial = this.partial;
23898
- this.debug("match", f, this.pattern);
23899
- if (this.comment)
23900
- return false;
23901
- if (this.empty)
23902
- return f === "";
23903
- if (f === "/" && partial)
23904
- return true;
23905
- var options = this.options;
23906
- if (path.sep !== "/") {
23907
- f = f.split(path.sep).join("/");
23908
- }
23909
- f = f.split(slashSplit);
23910
- this.debug(this.pattern, "split", f);
23911
- var set = this.set;
23912
- this.debug(this.pattern, "set", set);
23913
- var filename;
23914
- var i;
23915
- for (i = f.length - 1; i >= 0; i--) {
23916
- filename = f[i];
23917
- if (filename)
23918
- break;
23919
- }
23920
- for (i = 0; i < set.length; i++) {
23921
- var pattern = set[i];
23922
- var file = f;
23923
- if (options.matchBase && pattern.length === 1) {
23924
- file = [filename];
23925
- }
23926
- var hit = this.matchOne(file, pattern, partial);
23927
- if (hit) {
23928
- if (options.flipNegate)
23929
- return true;
23930
- return !this.negate;
23931
- }
23932
- }
23933
- if (options.flipNegate)
23934
- return false;
23935
- return this.negate;
23936
- };
23937
- Minimatch.prototype.matchOne = function(file, pattern, partial) {
23938
- var options = this.options;
23939
- this.debug("matchOne", { "this": this, file, pattern });
23940
- this.debug("matchOne", file.length, pattern.length);
23941
- for (var fi = 0, pi = 0, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {
23942
- this.debug("matchOne loop");
23943
- var p = pattern[pi];
23944
- var f = file[fi];
23945
- this.debug(pattern, p, f);
23946
- if (p === false)
23992
+ match(f, partial = this.partial) {
23993
+ this.debug("match", f, this.pattern);
23994
+ if (this.comment)
23947
23995
  return false;
23948
- if (p === GLOBSTAR) {
23949
- this.debug("GLOBSTAR", [pattern, p, f]);
23950
- var fr = fi;
23951
- var pr = pi + 1;
23952
- if (pr === pl) {
23953
- this.debug("** at the end");
23954
- for (; fi < fl; fi++) {
23955
- if (file[fi] === "." || file[fi] === ".." || !options.dot && file[fi].charAt(0) === ".")
23956
- return false;
23957
- }
23958
- return true;
23959
- }
23960
- while (fr < fl) {
23961
- var swallowee = file[fr];
23962
- this.debug("\nglobstar while", file, fr, pattern, pr, swallowee);
23963
- if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {
23964
- this.debug("globstar found match!", fr, fl, swallowee);
23965
- return true;
23966
- } else {
23967
- if (swallowee === "." || swallowee === ".." || !options.dot && swallowee.charAt(0) === ".") {
23968
- this.debug("dot detected!", file, fr, pattern, pr);
23969
- break;
23970
- }
23971
- this.debug("globstar swallow a segment, and continue");
23972
- fr++;
23973
- }
23996
+ if (this.empty)
23997
+ return f === "";
23998
+ if (f === "/" && partial)
23999
+ return true;
24000
+ const options = this.options;
24001
+ if (path.sep !== "/") {
24002
+ f = f.split(path.sep).join("/");
24003
+ }
24004
+ f = f.split(slashSplit);
24005
+ this.debug(this.pattern, "split", f);
24006
+ const set = this.set;
24007
+ this.debug(this.pattern, "set", set);
24008
+ let filename;
24009
+ for (let i = f.length - 1; i >= 0; i--) {
24010
+ filename = f[i];
24011
+ if (filename)
24012
+ break;
24013
+ }
24014
+ for (let i = 0; i < set.length; i++) {
24015
+ const pattern = set[i];
24016
+ let file = f;
24017
+ if (options.matchBase && pattern.length === 1) {
24018
+ file = [filename];
23974
24019
  }
23975
- if (partial) {
23976
- this.debug("\n>>> no match, partial?", file, fr, pattern, pr);
23977
- if (fr === fl)
24020
+ const hit = this.matchOne(file, pattern, partial);
24021
+ if (hit) {
24022
+ if (options.flipNegate)
23978
24023
  return true;
24024
+ return !this.negate;
23979
24025
  }
23980
- return false;
23981
- }
23982
- var hit;
23983
- if (typeof p === "string") {
23984
- hit = f === p;
23985
- this.debug("string match", p, f, hit);
23986
- } else {
23987
- hit = f.match(p);
23988
- this.debug("pattern match", p, f, hit);
23989
24026
  }
23990
- if (!hit)
24027
+ if (options.flipNegate)
23991
24028
  return false;
24029
+ return this.negate;
23992
24030
  }
23993
- if (fi === fl && pi === pl) {
23994
- return true;
23995
- } else if (fi === fl) {
23996
- return partial;
23997
- } else if (pi === pl) {
23998
- return fi === fl - 1 && file[fi] === "";
24031
+ static defaults(def) {
24032
+ return minimatch.defaults(def).Minimatch;
23999
24033
  }
24000
- throw new Error("wtf?");
24001
24034
  };
24002
- function globUnescape(s) {
24003
- return s.replace(/\\(.)/g, "$1");
24004
- }
24005
- function regExpEscape(s) {
24006
- return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
24007
- }
24035
+ minimatch.Minimatch = Minimatch;
24008
24036
  }
24009
24037
  });
24010
24038
 
@@ -24045,14 +24073,14 @@ var require_readdir_glob = __commonJS({
24045
24073
  });
24046
24074
  });
24047
24075
  }
24048
- function stat(file, followSyslinks) {
24076
+ function stat(file, followSymlinks) {
24049
24077
  return new Promise((resolve2, reject) => {
24050
- const statFunc = followSyslinks ? fs.stat : fs.lstat;
24078
+ const statFunc = followSymlinks ? fs.stat : fs.lstat;
24051
24079
  statFunc(file, (err, stats) => {
24052
24080
  if (err) {
24053
24081
  switch (err.code) {
24054
24082
  case "ENOENT":
24055
- if (followSyslinks) {
24083
+ if (followSymlinks) {
24056
24084
  resolve2(stat(file, false));
24057
24085
  } else {
24058
24086
  resolve2(null);
@@ -24068,7 +24096,7 @@ var require_readdir_glob = __commonJS({
24068
24096
  });
24069
24097
  });
24070
24098
  }
24071
- async function* exploreWalkAsync(dir, path, followSyslinks, useStat, shouldSkip, strict) {
24099
+ async function* exploreWalkAsync(dir, path, followSymlinks, useStat, shouldSkip, strict) {
24072
24100
  let files = await readdir(path + dir, strict);
24073
24101
  for (const file of files) {
24074
24102
  let name = file.name;
@@ -24080,8 +24108,8 @@ var require_readdir_glob = __commonJS({
24080
24108
  const relative = filename.slice(1);
24081
24109
  const absolute = path + "/" + relative;
24082
24110
  let stats = null;
24083
- if (useStat || followSyslinks) {
24084
- stats = await stat(absolute, followSyslinks);
24111
+ if (useStat || followSymlinks) {
24112
+ stats = await stat(absolute, followSymlinks);
24085
24113
  }
24086
24114
  if (!stats && file.name !== void 0) {
24087
24115
  stats = file;
@@ -24092,15 +24120,15 @@ var require_readdir_glob = __commonJS({
24092
24120
  if (stats.isDirectory()) {
24093
24121
  if (!shouldSkip(relative)) {
24094
24122
  yield { relative, absolute, stats };
24095
- yield* exploreWalkAsync(filename, path, followSyslinks, useStat, shouldSkip, false);
24123
+ yield* exploreWalkAsync(filename, path, followSymlinks, useStat, shouldSkip, false);
24096
24124
  }
24097
24125
  } else {
24098
24126
  yield { relative, absolute, stats };
24099
24127
  }
24100
24128
  }
24101
24129
  }
24102
- async function* explore(path, followSyslinks, useStat, shouldSkip) {
24103
- yield* exploreWalkAsync("", path, followSyslinks, useStat, shouldSkip, true);
24130
+ async function* explore(path, followSymlinks, useStat, shouldSkip) {
24131
+ yield* exploreWalkAsync("", path, followSymlinks, useStat, shouldSkip, true);
24104
24132
  }
24105
24133
  function readOptions(options) {
24106
24134
  return {
@@ -27769,7 +27797,7 @@ var require_stream_readable = __commonJS({
27769
27797
  debug("ondata");
27770
27798
  increasedAwaitDrain = false;
27771
27799
  var ret = dest.write(chunk);
27772
- if (ret === false && !increasedAwaitDrain) {
27800
+ if (false === ret && !increasedAwaitDrain) {
27773
27801
  if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) {
27774
27802
  debug("false write response, pause", src._readableState.awaitDrain);
27775
27803
  src._readableState.awaitDrain++;
@@ -27911,7 +27939,7 @@ var require_stream_readable = __commonJS({
27911
27939
  }
27912
27940
  Readable.prototype.pause = function() {
27913
27941
  debug("call pause flowing=%j", this._readableState.flowing);
27914
- if (this._readableState.flowing !== false) {
27942
+ if (false !== this._readableState.flowing) {
27915
27943
  debug("pause");
27916
27944
  this._readableState.flowing = false;
27917
27945
  this.emit("pause");
@@ -29900,7 +29928,7 @@ var require_stream_readable2 = __commonJS({
29900
29928
  debug("ondata");
29901
29929
  increasedAwaitDrain = false;
29902
29930
  var ret = dest.write(chunk);
29903
- if (ret === false && !increasedAwaitDrain) {
29931
+ if (false === ret && !increasedAwaitDrain) {
29904
29932
  if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) {
29905
29933
  debug("false write response, pause", src._readableState.awaitDrain);
29906
29934
  src._readableState.awaitDrain++;
@@ -30042,7 +30070,7 @@ var require_stream_readable2 = __commonJS({
30042
30070
  }
30043
30071
  Readable.prototype.pause = function() {
30044
30072
  debug("call pause flowing=%j", this._readableState.flowing);
30045
- if (this._readableState.flowing !== false) {
30073
+ if (false !== this._readableState.flowing) {
30046
30074
  debug("pause");
30047
30075
  this._readableState.flowing = false;
30048
30076
  this.emit("pause");
@@ -31572,6 +31600,758 @@ var require_fs2 = __commonJS({
31572
31600
  }
31573
31601
  });
31574
31602
 
31603
+ // ../component-lib/node_modules/concat-map/index.js
31604
+ var require_concat_map = __commonJS({
31605
+ "../component-lib/node_modules/concat-map/index.js"(exports, module2) {
31606
+ module2.exports = function(xs, fn) {
31607
+ var res = [];
31608
+ for (var i = 0; i < xs.length; i++) {
31609
+ var x = fn(xs[i], i);
31610
+ if (isArray(x))
31611
+ res.push.apply(res, x);
31612
+ else
31613
+ res.push(x);
31614
+ }
31615
+ return res;
31616
+ };
31617
+ var isArray = Array.isArray || function(xs) {
31618
+ return Object.prototype.toString.call(xs) === "[object Array]";
31619
+ };
31620
+ }
31621
+ });
31622
+
31623
+ // ../component-lib/node_modules/brace-expansion/index.js
31624
+ var require_brace_expansion2 = __commonJS({
31625
+ "../component-lib/node_modules/brace-expansion/index.js"(exports, module2) {
31626
+ var concatMap = require_concat_map();
31627
+ var balanced = require_balanced_match();
31628
+ module2.exports = expandTop;
31629
+ var escSlash = "\0SLASH" + Math.random() + "\0";
31630
+ var escOpen = "\0OPEN" + Math.random() + "\0";
31631
+ var escClose = "\0CLOSE" + Math.random() + "\0";
31632
+ var escComma = "\0COMMA" + Math.random() + "\0";
31633
+ var escPeriod = "\0PERIOD" + Math.random() + "\0";
31634
+ function numeric(str) {
31635
+ return parseInt(str, 10) == str ? parseInt(str, 10) : str.charCodeAt(0);
31636
+ }
31637
+ function escapeBraces(str) {
31638
+ return str.split("\\\\").join(escSlash).split("\\{").join(escOpen).split("\\}").join(escClose).split("\\,").join(escComma).split("\\.").join(escPeriod);
31639
+ }
31640
+ function unescapeBraces(str) {
31641
+ return str.split(escSlash).join("\\").split(escOpen).join("{").split(escClose).join("}").split(escComma).join(",").split(escPeriod).join(".");
31642
+ }
31643
+ function parseCommaParts(str) {
31644
+ if (!str)
31645
+ return [""];
31646
+ var parts = [];
31647
+ var m = balanced("{", "}", str);
31648
+ if (!m)
31649
+ return str.split(",");
31650
+ var pre = m.pre;
31651
+ var body = m.body;
31652
+ var post = m.post;
31653
+ var p = pre.split(",");
31654
+ p[p.length - 1] += "{" + body + "}";
31655
+ var postParts = parseCommaParts(post);
31656
+ if (post.length) {
31657
+ p[p.length - 1] += postParts.shift();
31658
+ p.push.apply(p, postParts);
31659
+ }
31660
+ parts.push.apply(parts, p);
31661
+ return parts;
31662
+ }
31663
+ function expandTop(str) {
31664
+ if (!str)
31665
+ return [];
31666
+ if (str.substr(0, 2) === "{}") {
31667
+ str = "\\{\\}" + str.substr(2);
31668
+ }
31669
+ return expand(escapeBraces(str), true).map(unescapeBraces);
31670
+ }
31671
+ function embrace(str) {
31672
+ return "{" + str + "}";
31673
+ }
31674
+ function isPadded(el) {
31675
+ return /^-?0\d/.test(el);
31676
+ }
31677
+ function lte(i, y) {
31678
+ return i <= y;
31679
+ }
31680
+ function gte(i, y) {
31681
+ return i >= y;
31682
+ }
31683
+ function expand(str, isTop) {
31684
+ var expansions = [];
31685
+ var m = balanced("{", "}", str);
31686
+ if (!m || /\$$/.test(m.pre))
31687
+ return [str];
31688
+ var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body);
31689
+ var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body);
31690
+ var isSequence = isNumericSequence || isAlphaSequence;
31691
+ var isOptions = m.body.indexOf(",") >= 0;
31692
+ if (!isSequence && !isOptions) {
31693
+ if (m.post.match(/,.*\}/)) {
31694
+ str = m.pre + "{" + m.body + escClose + m.post;
31695
+ return expand(str);
31696
+ }
31697
+ return [str];
31698
+ }
31699
+ var n;
31700
+ if (isSequence) {
31701
+ n = m.body.split(/\.\./);
31702
+ } else {
31703
+ n = parseCommaParts(m.body);
31704
+ if (n.length === 1) {
31705
+ n = expand(n[0], false).map(embrace);
31706
+ if (n.length === 1) {
31707
+ var post = m.post.length ? expand(m.post, false) : [""];
31708
+ return post.map(function(p) {
31709
+ return m.pre + n[0] + p;
31710
+ });
31711
+ }
31712
+ }
31713
+ }
31714
+ var pre = m.pre;
31715
+ var post = m.post.length ? expand(m.post, false) : [""];
31716
+ var N;
31717
+ if (isSequence) {
31718
+ var x = numeric(n[0]);
31719
+ var y = numeric(n[1]);
31720
+ var width = Math.max(n[0].length, n[1].length);
31721
+ var incr = n.length == 3 ? Math.abs(numeric(n[2])) : 1;
31722
+ var test = lte;
31723
+ var reverse = y < x;
31724
+ if (reverse) {
31725
+ incr *= -1;
31726
+ test = gte;
31727
+ }
31728
+ var pad = n.some(isPadded);
31729
+ N = [];
31730
+ for (var i = x; test(i, y); i += incr) {
31731
+ var c;
31732
+ if (isAlphaSequence) {
31733
+ c = String.fromCharCode(i);
31734
+ if (c === "\\")
31735
+ c = "";
31736
+ } else {
31737
+ c = String(i);
31738
+ if (pad) {
31739
+ var need = width - c.length;
31740
+ if (need > 0) {
31741
+ var z = new Array(need + 1).join("0");
31742
+ if (i < 0)
31743
+ c = "-" + z + c.slice(1);
31744
+ else
31745
+ c = z + c;
31746
+ }
31747
+ }
31748
+ }
31749
+ N.push(c);
31750
+ }
31751
+ } else {
31752
+ N = concatMap(n, function(el) {
31753
+ return expand(el, false);
31754
+ });
31755
+ }
31756
+ for (var j = 0; j < N.length; j++) {
31757
+ for (var k = 0; k < post.length; k++) {
31758
+ var expansion = pre + N[j] + post[k];
31759
+ if (!isTop || isSequence || expansion)
31760
+ expansions.push(expansion);
31761
+ }
31762
+ }
31763
+ return expansions;
31764
+ }
31765
+ }
31766
+ });
31767
+
31768
+ // ../component-lib/node_modules/minimatch/minimatch.js
31769
+ var require_minimatch2 = __commonJS({
31770
+ "../component-lib/node_modules/minimatch/minimatch.js"(exports, module2) {
31771
+ module2.exports = minimatch;
31772
+ minimatch.Minimatch = Minimatch;
31773
+ var path = function() {
31774
+ try {
31775
+ return require("path");
31776
+ } catch (e) {
31777
+ }
31778
+ }() || {
31779
+ sep: "/"
31780
+ };
31781
+ minimatch.sep = path.sep;
31782
+ var GLOBSTAR = minimatch.GLOBSTAR = Minimatch.GLOBSTAR = {};
31783
+ var expand = require_brace_expansion2();
31784
+ var plTypes = {
31785
+ "!": { open: "(?:(?!(?:", close: "))[^/]*?)" },
31786
+ "?": { open: "(?:", close: ")?" },
31787
+ "+": { open: "(?:", close: ")+" },
31788
+ "*": { open: "(?:", close: ")*" },
31789
+ "@": { open: "(?:", close: ")" }
31790
+ };
31791
+ var qmark = "[^/]";
31792
+ var star = qmark + "*?";
31793
+ var twoStarDot = "(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?";
31794
+ var twoStarNoDot = "(?:(?!(?:\\/|^)\\.).)*?";
31795
+ var reSpecials = charSet("().*{}+?[]^$\\!");
31796
+ function charSet(s) {
31797
+ return s.split("").reduce(function(set, c) {
31798
+ set[c] = true;
31799
+ return set;
31800
+ }, {});
31801
+ }
31802
+ var slashSplit = /\/+/;
31803
+ minimatch.filter = filter;
31804
+ function filter(pattern, options) {
31805
+ options = options || {};
31806
+ return function(p, i, list) {
31807
+ return minimatch(p, pattern, options);
31808
+ };
31809
+ }
31810
+ function ext(a, b) {
31811
+ b = b || {};
31812
+ var t = {};
31813
+ Object.keys(a).forEach(function(k) {
31814
+ t[k] = a[k];
31815
+ });
31816
+ Object.keys(b).forEach(function(k) {
31817
+ t[k] = b[k];
31818
+ });
31819
+ return t;
31820
+ }
31821
+ minimatch.defaults = function(def) {
31822
+ if (!def || typeof def !== "object" || !Object.keys(def).length) {
31823
+ return minimatch;
31824
+ }
31825
+ var orig = minimatch;
31826
+ var m = function minimatch2(p, pattern, options) {
31827
+ return orig(p, pattern, ext(def, options));
31828
+ };
31829
+ m.Minimatch = function Minimatch2(pattern, options) {
31830
+ return new orig.Minimatch(pattern, ext(def, options));
31831
+ };
31832
+ m.Minimatch.defaults = function defaults(options) {
31833
+ return orig.defaults(ext(def, options)).Minimatch;
31834
+ };
31835
+ m.filter = function filter2(pattern, options) {
31836
+ return orig.filter(pattern, ext(def, options));
31837
+ };
31838
+ m.defaults = function defaults(options) {
31839
+ return orig.defaults(ext(def, options));
31840
+ };
31841
+ m.makeRe = function makeRe2(pattern, options) {
31842
+ return orig.makeRe(pattern, ext(def, options));
31843
+ };
31844
+ m.braceExpand = function braceExpand2(pattern, options) {
31845
+ return orig.braceExpand(pattern, ext(def, options));
31846
+ };
31847
+ m.match = function(list, pattern, options) {
31848
+ return orig.match(list, pattern, ext(def, options));
31849
+ };
31850
+ return m;
31851
+ };
31852
+ Minimatch.defaults = function(def) {
31853
+ return minimatch.defaults(def).Minimatch;
31854
+ };
31855
+ function minimatch(p, pattern, options) {
31856
+ assertValidPattern(pattern);
31857
+ if (!options)
31858
+ options = {};
31859
+ if (!options.nocomment && pattern.charAt(0) === "#") {
31860
+ return false;
31861
+ }
31862
+ return new Minimatch(pattern, options).match(p);
31863
+ }
31864
+ function Minimatch(pattern, options) {
31865
+ if (!(this instanceof Minimatch)) {
31866
+ return new Minimatch(pattern, options);
31867
+ }
31868
+ assertValidPattern(pattern);
31869
+ if (!options)
31870
+ options = {};
31871
+ pattern = pattern.trim();
31872
+ if (!options.allowWindowsEscape && path.sep !== "/") {
31873
+ pattern = pattern.split(path.sep).join("/");
31874
+ }
31875
+ this.options = options;
31876
+ this.set = [];
31877
+ this.pattern = pattern;
31878
+ this.regexp = null;
31879
+ this.negate = false;
31880
+ this.comment = false;
31881
+ this.empty = false;
31882
+ this.partial = !!options.partial;
31883
+ this.make();
31884
+ }
31885
+ Minimatch.prototype.debug = function() {
31886
+ };
31887
+ Minimatch.prototype.make = make;
31888
+ function make() {
31889
+ var pattern = this.pattern;
31890
+ var options = this.options;
31891
+ if (!options.nocomment && pattern.charAt(0) === "#") {
31892
+ this.comment = true;
31893
+ return;
31894
+ }
31895
+ if (!pattern) {
31896
+ this.empty = true;
31897
+ return;
31898
+ }
31899
+ this.parseNegate();
31900
+ var set = this.globSet = this.braceExpand();
31901
+ if (options.debug)
31902
+ this.debug = function debug() {
31903
+ console.error.apply(console, arguments);
31904
+ };
31905
+ this.debug(this.pattern, set);
31906
+ set = this.globParts = set.map(function(s) {
31907
+ return s.split(slashSplit);
31908
+ });
31909
+ this.debug(this.pattern, set);
31910
+ set = set.map(function(s, si, set2) {
31911
+ return s.map(this.parse, this);
31912
+ }, this);
31913
+ this.debug(this.pattern, set);
31914
+ set = set.filter(function(s) {
31915
+ return s.indexOf(false) === -1;
31916
+ });
31917
+ this.debug(this.pattern, set);
31918
+ this.set = set;
31919
+ }
31920
+ Minimatch.prototype.parseNegate = parseNegate;
31921
+ function parseNegate() {
31922
+ var pattern = this.pattern;
31923
+ var negate = false;
31924
+ var options = this.options;
31925
+ var negateOffset = 0;
31926
+ if (options.nonegate)
31927
+ return;
31928
+ for (var i = 0, l = pattern.length; i < l && pattern.charAt(i) === "!"; i++) {
31929
+ negate = !negate;
31930
+ negateOffset++;
31931
+ }
31932
+ if (negateOffset)
31933
+ this.pattern = pattern.substr(negateOffset);
31934
+ this.negate = negate;
31935
+ }
31936
+ minimatch.braceExpand = function(pattern, options) {
31937
+ return braceExpand(pattern, options);
31938
+ };
31939
+ Minimatch.prototype.braceExpand = braceExpand;
31940
+ function braceExpand(pattern, options) {
31941
+ if (!options) {
31942
+ if (this instanceof Minimatch) {
31943
+ options = this.options;
31944
+ } else {
31945
+ options = {};
31946
+ }
31947
+ }
31948
+ pattern = typeof pattern === "undefined" ? this.pattern : pattern;
31949
+ assertValidPattern(pattern);
31950
+ if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) {
31951
+ return [pattern];
31952
+ }
31953
+ return expand(pattern);
31954
+ }
31955
+ var MAX_PATTERN_LENGTH = 1024 * 64;
31956
+ var assertValidPattern = function(pattern) {
31957
+ if (typeof pattern !== "string") {
31958
+ throw new TypeError("invalid pattern");
31959
+ }
31960
+ if (pattern.length > MAX_PATTERN_LENGTH) {
31961
+ throw new TypeError("pattern is too long");
31962
+ }
31963
+ };
31964
+ Minimatch.prototype.parse = parse;
31965
+ var SUBPARSE = {};
31966
+ function parse(pattern, isSub) {
31967
+ assertValidPattern(pattern);
31968
+ var options = this.options;
31969
+ if (pattern === "**") {
31970
+ if (!options.noglobstar)
31971
+ return GLOBSTAR;
31972
+ else
31973
+ pattern = "*";
31974
+ }
31975
+ if (pattern === "")
31976
+ return "";
31977
+ var re = "";
31978
+ var hasMagic = !!options.nocase;
31979
+ var escaping = false;
31980
+ var patternListStack = [];
31981
+ var negativeLists = [];
31982
+ var stateChar;
31983
+ var inClass = false;
31984
+ var reClassStart = -1;
31985
+ var classStart = -1;
31986
+ var patternStart = pattern.charAt(0) === "." ? "" : options.dot ? "(?!(?:^|\\/)\\.{1,2}(?:$|\\/))" : "(?!\\.)";
31987
+ var self2 = this;
31988
+ function clearStateChar() {
31989
+ if (stateChar) {
31990
+ switch (stateChar) {
31991
+ case "*":
31992
+ re += star;
31993
+ hasMagic = true;
31994
+ break;
31995
+ case "?":
31996
+ re += qmark;
31997
+ hasMagic = true;
31998
+ break;
31999
+ default:
32000
+ re += "\\" + stateChar;
32001
+ break;
32002
+ }
32003
+ self2.debug("clearStateChar %j %j", stateChar, re);
32004
+ stateChar = false;
32005
+ }
32006
+ }
32007
+ for (var i = 0, len = pattern.length, c; i < len && (c = pattern.charAt(i)); i++) {
32008
+ this.debug("%s %s %s %j", pattern, i, re, c);
32009
+ if (escaping && reSpecials[c]) {
32010
+ re += "\\" + c;
32011
+ escaping = false;
32012
+ continue;
32013
+ }
32014
+ switch (c) {
32015
+ case "/": {
32016
+ return false;
32017
+ }
32018
+ case "\\":
32019
+ clearStateChar();
32020
+ escaping = true;
32021
+ continue;
32022
+ case "?":
32023
+ case "*":
32024
+ case "+":
32025
+ case "@":
32026
+ case "!":
32027
+ this.debug("%s %s %s %j <-- stateChar", pattern, i, re, c);
32028
+ if (inClass) {
32029
+ this.debug(" in class");
32030
+ if (c === "!" && i === classStart + 1)
32031
+ c = "^";
32032
+ re += c;
32033
+ continue;
32034
+ }
32035
+ self2.debug("call clearStateChar %j", stateChar);
32036
+ clearStateChar();
32037
+ stateChar = c;
32038
+ if (options.noext)
32039
+ clearStateChar();
32040
+ continue;
32041
+ case "(":
32042
+ if (inClass) {
32043
+ re += "(";
32044
+ continue;
32045
+ }
32046
+ if (!stateChar) {
32047
+ re += "\\(";
32048
+ continue;
32049
+ }
32050
+ patternListStack.push({
32051
+ type: stateChar,
32052
+ start: i - 1,
32053
+ reStart: re.length,
32054
+ open: plTypes[stateChar].open,
32055
+ close: plTypes[stateChar].close
32056
+ });
32057
+ re += stateChar === "!" ? "(?:(?!(?:" : "(?:";
32058
+ this.debug("plType %j %j", stateChar, re);
32059
+ stateChar = false;
32060
+ continue;
32061
+ case ")":
32062
+ if (inClass || !patternListStack.length) {
32063
+ re += "\\)";
32064
+ continue;
32065
+ }
32066
+ clearStateChar();
32067
+ hasMagic = true;
32068
+ var pl = patternListStack.pop();
32069
+ re += pl.close;
32070
+ if (pl.type === "!") {
32071
+ negativeLists.push(pl);
32072
+ }
32073
+ pl.reEnd = re.length;
32074
+ continue;
32075
+ case "|":
32076
+ if (inClass || !patternListStack.length || escaping) {
32077
+ re += "\\|";
32078
+ escaping = false;
32079
+ continue;
32080
+ }
32081
+ clearStateChar();
32082
+ re += "|";
32083
+ continue;
32084
+ case "[":
32085
+ clearStateChar();
32086
+ if (inClass) {
32087
+ re += "\\" + c;
32088
+ continue;
32089
+ }
32090
+ inClass = true;
32091
+ classStart = i;
32092
+ reClassStart = re.length;
32093
+ re += c;
32094
+ continue;
32095
+ case "]":
32096
+ if (i === classStart + 1 || !inClass) {
32097
+ re += "\\" + c;
32098
+ escaping = false;
32099
+ continue;
32100
+ }
32101
+ var cs = pattern.substring(classStart + 1, i);
32102
+ try {
32103
+ RegExp("[" + cs + "]");
32104
+ } catch (er) {
32105
+ var sp = this.parse(cs, SUBPARSE);
32106
+ re = re.substr(0, reClassStart) + "\\[" + sp[0] + "\\]";
32107
+ hasMagic = hasMagic || sp[1];
32108
+ inClass = false;
32109
+ continue;
32110
+ }
32111
+ hasMagic = true;
32112
+ inClass = false;
32113
+ re += c;
32114
+ continue;
32115
+ default:
32116
+ clearStateChar();
32117
+ if (escaping) {
32118
+ escaping = false;
32119
+ } else if (reSpecials[c] && !(c === "^" && inClass)) {
32120
+ re += "\\";
32121
+ }
32122
+ re += c;
32123
+ }
32124
+ }
32125
+ if (inClass) {
32126
+ cs = pattern.substr(classStart + 1);
32127
+ sp = this.parse(cs, SUBPARSE);
32128
+ re = re.substr(0, reClassStart) + "\\[" + sp[0];
32129
+ hasMagic = hasMagic || sp[1];
32130
+ }
32131
+ for (pl = patternListStack.pop(); pl; pl = patternListStack.pop()) {
32132
+ var tail = re.slice(pl.reStart + pl.open.length);
32133
+ this.debug("setting tail", re, pl);
32134
+ tail = tail.replace(/((?:\\{2}){0,64})(\\?)\|/g, function(_2, $1, $2) {
32135
+ if (!$2) {
32136
+ $2 = "\\";
32137
+ }
32138
+ return $1 + $1 + $2 + "|";
32139
+ });
32140
+ this.debug("tail=%j\n %s", tail, tail, pl, re);
32141
+ var t = pl.type === "*" ? star : pl.type === "?" ? qmark : "\\" + pl.type;
32142
+ hasMagic = true;
32143
+ re = re.slice(0, pl.reStart) + t + "\\(" + tail;
32144
+ }
32145
+ clearStateChar();
32146
+ if (escaping) {
32147
+ re += "\\\\";
32148
+ }
32149
+ var addPatternStart = false;
32150
+ switch (re.charAt(0)) {
32151
+ case "[":
32152
+ case ".":
32153
+ case "(":
32154
+ addPatternStart = true;
32155
+ }
32156
+ for (var n = negativeLists.length - 1; n > -1; n--) {
32157
+ var nl = negativeLists[n];
32158
+ var nlBefore = re.slice(0, nl.reStart);
32159
+ var nlFirst = re.slice(nl.reStart, nl.reEnd - 8);
32160
+ var nlLast = re.slice(nl.reEnd - 8, nl.reEnd);
32161
+ var nlAfter = re.slice(nl.reEnd);
32162
+ nlLast += nlAfter;
32163
+ var openParensBefore = nlBefore.split("(").length - 1;
32164
+ var cleanAfter = nlAfter;
32165
+ for (i = 0; i < openParensBefore; i++) {
32166
+ cleanAfter = cleanAfter.replace(/\)[+*?]?/, "");
32167
+ }
32168
+ nlAfter = cleanAfter;
32169
+ var dollar = "";
32170
+ if (nlAfter === "" && isSub !== SUBPARSE) {
32171
+ dollar = "$";
32172
+ }
32173
+ var newRe = nlBefore + nlFirst + nlAfter + dollar + nlLast;
32174
+ re = newRe;
32175
+ }
32176
+ if (re !== "" && hasMagic) {
32177
+ re = "(?=.)" + re;
32178
+ }
32179
+ if (addPatternStart) {
32180
+ re = patternStart + re;
32181
+ }
32182
+ if (isSub === SUBPARSE) {
32183
+ return [re, hasMagic];
32184
+ }
32185
+ if (!hasMagic) {
32186
+ return globUnescape(pattern);
32187
+ }
32188
+ var flags = options.nocase ? "i" : "";
32189
+ try {
32190
+ var regExp = new RegExp("^" + re + "$", flags);
32191
+ } catch (er) {
32192
+ return new RegExp("$.");
32193
+ }
32194
+ regExp._glob = pattern;
32195
+ regExp._src = re;
32196
+ return regExp;
32197
+ }
32198
+ minimatch.makeRe = function(pattern, options) {
32199
+ return new Minimatch(pattern, options || {}).makeRe();
32200
+ };
32201
+ Minimatch.prototype.makeRe = makeRe;
32202
+ function makeRe() {
32203
+ if (this.regexp || this.regexp === false)
32204
+ return this.regexp;
32205
+ var set = this.set;
32206
+ if (!set.length) {
32207
+ this.regexp = false;
32208
+ return this.regexp;
32209
+ }
32210
+ var options = this.options;
32211
+ var twoStar = options.noglobstar ? star : options.dot ? twoStarDot : twoStarNoDot;
32212
+ var flags = options.nocase ? "i" : "";
32213
+ var re = set.map(function(pattern) {
32214
+ return pattern.map(function(p) {
32215
+ return p === GLOBSTAR ? twoStar : typeof p === "string" ? regExpEscape(p) : p._src;
32216
+ }).join("\\/");
32217
+ }).join("|");
32218
+ re = "^(?:" + re + ")$";
32219
+ if (this.negate)
32220
+ re = "^(?!" + re + ").*$";
32221
+ try {
32222
+ this.regexp = new RegExp(re, flags);
32223
+ } catch (ex) {
32224
+ this.regexp = false;
32225
+ }
32226
+ return this.regexp;
32227
+ }
32228
+ minimatch.match = function(list, pattern, options) {
32229
+ options = options || {};
32230
+ var mm = new Minimatch(pattern, options);
32231
+ list = list.filter(function(f) {
32232
+ return mm.match(f);
32233
+ });
32234
+ if (mm.options.nonull && !list.length) {
32235
+ list.push(pattern);
32236
+ }
32237
+ return list;
32238
+ };
32239
+ Minimatch.prototype.match = function match(f, partial) {
32240
+ if (typeof partial === "undefined")
32241
+ partial = this.partial;
32242
+ this.debug("match", f, this.pattern);
32243
+ if (this.comment)
32244
+ return false;
32245
+ if (this.empty)
32246
+ return f === "";
32247
+ if (f === "/" && partial)
32248
+ return true;
32249
+ var options = this.options;
32250
+ if (path.sep !== "/") {
32251
+ f = f.split(path.sep).join("/");
32252
+ }
32253
+ f = f.split(slashSplit);
32254
+ this.debug(this.pattern, "split", f);
32255
+ var set = this.set;
32256
+ this.debug(this.pattern, "set", set);
32257
+ var filename;
32258
+ var i;
32259
+ for (i = f.length - 1; i >= 0; i--) {
32260
+ filename = f[i];
32261
+ if (filename)
32262
+ break;
32263
+ }
32264
+ for (i = 0; i < set.length; i++) {
32265
+ var pattern = set[i];
32266
+ var file = f;
32267
+ if (options.matchBase && pattern.length === 1) {
32268
+ file = [filename];
32269
+ }
32270
+ var hit = this.matchOne(file, pattern, partial);
32271
+ if (hit) {
32272
+ if (options.flipNegate)
32273
+ return true;
32274
+ return !this.negate;
32275
+ }
32276
+ }
32277
+ if (options.flipNegate)
32278
+ return false;
32279
+ return this.negate;
32280
+ };
32281
+ Minimatch.prototype.matchOne = function(file, pattern, partial) {
32282
+ var options = this.options;
32283
+ this.debug("matchOne", { "this": this, file, pattern });
32284
+ this.debug("matchOne", file.length, pattern.length);
32285
+ for (var fi = 0, pi = 0, fl = file.length, pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {
32286
+ this.debug("matchOne loop");
32287
+ var p = pattern[pi];
32288
+ var f = file[fi];
32289
+ this.debug(pattern, p, f);
32290
+ if (p === false)
32291
+ return false;
32292
+ if (p === GLOBSTAR) {
32293
+ this.debug("GLOBSTAR", [pattern, p, f]);
32294
+ var fr = fi;
32295
+ var pr = pi + 1;
32296
+ if (pr === pl) {
32297
+ this.debug("** at the end");
32298
+ for (; fi < fl; fi++) {
32299
+ if (file[fi] === "." || file[fi] === ".." || !options.dot && file[fi].charAt(0) === ".")
32300
+ return false;
32301
+ }
32302
+ return true;
32303
+ }
32304
+ while (fr < fl) {
32305
+ var swallowee = file[fr];
32306
+ this.debug("\nglobstar while", file, fr, pattern, pr, swallowee);
32307
+ if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {
32308
+ this.debug("globstar found match!", fr, fl, swallowee);
32309
+ return true;
32310
+ } else {
32311
+ if (swallowee === "." || swallowee === ".." || !options.dot && swallowee.charAt(0) === ".") {
32312
+ this.debug("dot detected!", file, fr, pattern, pr);
32313
+ break;
32314
+ }
32315
+ this.debug("globstar swallow a segment, and continue");
32316
+ fr++;
32317
+ }
32318
+ }
32319
+ if (partial) {
32320
+ this.debug("\n>>> no match, partial?", file, fr, pattern, pr);
32321
+ if (fr === fl)
32322
+ return true;
32323
+ }
32324
+ return false;
32325
+ }
32326
+ var hit;
32327
+ if (typeof p === "string") {
32328
+ hit = f === p;
32329
+ this.debug("string match", p, f, hit);
32330
+ } else {
32331
+ hit = f.match(p);
32332
+ this.debug("pattern match", p, f, hit);
32333
+ }
32334
+ if (!hit)
32335
+ return false;
32336
+ }
32337
+ if (fi === fl && pi === pl) {
32338
+ return true;
32339
+ } else if (fi === fl) {
32340
+ return partial;
32341
+ } else if (pi === pl) {
32342
+ return fi === fl - 1 && file[fi] === "";
32343
+ }
32344
+ throw new Error("wtf?");
32345
+ };
32346
+ function globUnescape(s) {
32347
+ return s.replace(/\\(.)/g, "$1");
32348
+ }
32349
+ function regExpEscape(s) {
32350
+ return s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
32351
+ }
32352
+ }
32353
+ });
32354
+
31575
32355
  // ../component-lib/node_modules/path-is-absolute/index.js
31576
32356
  var require_path_is_absolute = __commonJS({
31577
32357
  "../component-lib/node_modules/path-is-absolute/index.js"(exports, module2) {
@@ -31607,7 +32387,7 @@ var require_common = __commonJS({
31607
32387
  }
31608
32388
  var fs = require("fs");
31609
32389
  var path = require("path");
31610
- var minimatch = require_minimatch();
32390
+ var minimatch = require_minimatch2();
31611
32391
  var isAbsolute = require_path_is_absolute();
31612
32392
  var Minimatch = minimatch.Minimatch;
31613
32393
  function alphasort(a, b) {
@@ -31635,7 +32415,7 @@ var require_common = __commonJS({
31635
32415
  function setopts(self2, pattern, options) {
31636
32416
  if (!options)
31637
32417
  options = {};
31638
- if (options.matchBase && pattern.indexOf("/") === -1) {
32418
+ if (options.matchBase && -1 === pattern.indexOf("/")) {
31639
32419
  if (options.noglobstar) {
31640
32420
  throw new Error("base matching requires globstar");
31641
32421
  }
@@ -31792,7 +32572,7 @@ var require_sync = __commonJS({
31792
32572
  module2.exports = globSync;
31793
32573
  globSync.GlobSync = GlobSync;
31794
32574
  var rp = require_fs2();
31795
- var minimatch = require_minimatch();
32575
+ var minimatch = require_minimatch2();
31796
32576
  var Minimatch = minimatch.Minimatch;
31797
32577
  var Glob = require_glob().Glob;
31798
32578
  var util = require("util");
@@ -32266,7 +33046,7 @@ var require_glob = __commonJS({
32266
33046
  "../component-lib/node_modules/glob/glob.js"(exports, module2) {
32267
33047
  module2.exports = glob;
32268
33048
  var rp = require_fs2();
32269
- var minimatch = require_minimatch();
33049
+ var minimatch = require_minimatch2();
32270
33050
  var Minimatch = minimatch.Minimatch;
32271
33051
  var inherits = require_inherits();
32272
33052
  var EE = require("events").EventEmitter;
@@ -36073,7 +36853,7 @@ var require_core3 = __commonJS({
36073
36853
  }
36074
36854
  var isDir = data.type === "directory";
36075
36855
  if (data.name) {
36076
- if (typeof data.prefix === "string" && data.prefix !== "") {
36856
+ if (typeof data.prefix === "string" && "" !== data.prefix) {
36077
36857
  data.name = data.prefix + "/" + data.name;
36078
36858
  data.prefix = null;
36079
36859
  }
@@ -37256,9 +38036,9 @@ var require_crc32 = __commonJS({
37256
38036
  var CRC32;
37257
38037
  (function(factory) {
37258
38038
  if (typeof DO_NOT_EXPORT_CRC === "undefined") {
37259
- if (typeof exports === "object") {
38039
+ if ("object" === typeof exports) {
37260
38040
  factory(exports);
37261
- } else if (typeof define === "function" && define.amd) {
38041
+ } else if ("function" === typeof define && define.amd) {
37262
38042
  define(function() {
37263
38043
  var module3 = {};
37264
38044
  factory(module3);
@@ -39819,9 +40599,21 @@ var require_joinAbsoluteUrlPath = __commonJS({
39819
40599
  Object.defineProperty(exports, "__esModule", { value: true });
39820
40600
  exports.joinAbsoluteUrlPath = void 0;
39821
40601
  function joinAbsoluteUrlPath(...args) {
39822
- return args.map((pathPart) => pathPart.replace(/(^\/+|\/+$)/g, "")).join("/");
40602
+ const [rootUrl] = args;
40603
+ const url = new URL(getSanitisedString(args), "http://example.com");
40604
+ if (urlIsAbsolute(rootUrl)) {
40605
+ return url.toString();
40606
+ } else {
40607
+ return url.pathname.replace(/(^\/|\/$)/g, "");
40608
+ }
39823
40609
  }
39824
40610
  exports.joinAbsoluteUrlPath = joinAbsoluteUrlPath;
40611
+ function getSanitisedString(subdirs) {
40612
+ return subdirs.map((dir) => dir.replace(/(^\.\/+)|(^\/+|\/+$)/g, "")).join("/");
40613
+ }
40614
+ function urlIsAbsolute(url) {
40615
+ return url.match(/^http(s?):\/\//);
40616
+ }
39825
40617
  }
39826
40618
  });
39827
40619
 
@@ -39960,6 +40752,7 @@ var require_lib6 = __commonJS({
39960
40752
  __exportStar(require_v12(), exports);
39961
40753
  __exportStar(require_parseEnvVarForVar(), exports);
39962
40754
  __exportStar(require_getNodeEnv(), exports);
40755
+ __exportStar(require_isPathTryingToAccessOutsideOfRoot(), exports);
39963
40756
  }
39964
40757
  });
39965
40758