@shopify/create-app 3.65.2 → 3.66.0

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.
Files changed (86) hide show
  1. package/dist/chunk-2RSJVBMF.js +5625 -0
  2. package/dist/{chunk-Z65QJ5D7.js → chunk-4DRC2PSU.js} +17 -30
  3. package/dist/chunk-4OD45DDO.js +31508 -0
  4. package/dist/chunk-522OB3EU.js +45 -0
  5. package/dist/{chunk-JTKTLA7L.js → chunk-5U24TEX5.js} +5434 -10324
  6. package/dist/{chunk-GJPZCXGT.js → chunk-6A7MXLVB.js} +159 -405
  7. package/dist/{chunk-ZYKRTO5P.js → chunk-7ZCQLP5Y.js} +3 -3
  8. package/dist/{chunk-5LBEKXRW.js → chunk-FIJKOZJF.js} +19 -55
  9. package/dist/{chunk-QSKQTKTB.js → chunk-FT6PCF6E.js} +2441 -5551
  10. package/dist/chunk-GIUM5DCQ.js +2144 -0
  11. package/dist/chunk-HIAKHDLR.js +54 -0
  12. package/dist/chunk-LLSRDN3T.js +15352 -0
  13. package/dist/chunk-LTDD2GRL.js +111 -0
  14. package/dist/{chunk-63QVG2CD.js → chunk-NGBYQF44.js} +9 -9
  15. package/dist/chunk-NLC7NBUB.js +80 -0
  16. package/dist/{chunk-FMKVOTQK.js → chunk-O5K4AU7Q.js} +18 -34
  17. package/dist/chunk-OMDEA7TV.js +10615 -0
  18. package/dist/chunk-PNN7RS7Y.js +105 -0
  19. package/dist/{chunk-ZPL24Y2D.js → chunk-POZ5MGPT.js} +13 -18
  20. package/dist/chunk-T7T35H4F.js +108 -0
  21. package/dist/chunk-UBB7JKND.js +55 -0
  22. package/dist/chunk-VSLR7ET4.js +3034 -0
  23. package/dist/{chunk-SAO7C4LP.js → chunk-VZVGAREJ.js} +46821 -101962
  24. package/dist/{chunk-KDNBKIH4.js → chunk-WBQF4CSV.js} +12 -22
  25. package/dist/chunk-XVNW332R.js +524 -0
  26. package/dist/{chunk-YB6D4XQ7.js → chunk-Y4ECGRAF.js} +13 -23
  27. package/dist/chunk-ZAUZQLNO.js +3774 -0
  28. package/dist/chunk-ZULFH3SL.js +1847 -0
  29. package/dist/commands/init.d.ts +0 -1
  30. package/dist/commands/init.js +27 -27
  31. package/dist/commands/init.test.js +51 -70
  32. package/dist/{constants-24TFXZKQ.js → constants-WG7I7G3O.js} +5 -5
  33. package/dist/custom-oclif-loader-JKRJZ56E.js +47 -0
  34. package/dist/del-NW5KFKFP.js +1820 -0
  35. package/dist/devtools-UBOREV57.js +2572 -0
  36. package/dist/error-handler-26SLAJTC.js +35 -0
  37. package/dist/hooks/postrun.js +35 -42
  38. package/dist/hooks/prerun.js +58 -36
  39. package/dist/index.js +7 -7
  40. package/dist/lib-3K5QYF3J.js +9 -0
  41. package/dist/{local-3VUKCW4R.js → local-H6TW5MNX.js} +13 -13
  42. package/dist/magic-string.es-3RXPUXZF.js +843 -0
  43. package/dist/multipart-parser-QKUAJJP5.js +193 -0
  44. package/dist/{node-package-manager-HYZRZNU6.js → node-package-manager-QAUN6HGS.js} +16 -14
  45. package/dist/open-MZGVNFZO.js +197 -0
  46. package/dist/out-KDGAD475.js +6 -0
  47. package/dist/{path-CFPIDSWV.js → path-L375JOQ2.js} +4 -4
  48. package/dist/prompts/init.js +13 -13
  49. package/dist/prompts/init.test.js +42 -59
  50. package/dist/services/init.js +20 -20
  51. package/dist/services/init.test.js +5 -5
  52. package/dist/system-ZI2HKAKO.js +26 -0
  53. package/dist/tsconfig.tsbuildinfo +1 -1
  54. package/dist/{ui-7NEDEALP.js → ui-727JEZUX.js} +13 -13
  55. package/dist/utils/template/cleanup.js +13 -13
  56. package/dist/utils/template/cleanup.test.js +18 -30
  57. package/dist/utils/template/npm.js +15 -15
  58. package/dist/utils/template/npm.test.js +48 -87
  59. package/oclif.manifest.json +1 -1
  60. package/package.json +3 -4
  61. package/dist/chunk-3US34ZNP.js +0 -145
  62. package/dist/chunk-3XYIOBQ2.js +0 -22131
  63. package/dist/chunk-6IZMEXPW.js +0 -105
  64. package/dist/chunk-7DRS5WXI.js +0 -7843
  65. package/dist/chunk-DL3MKXVR.js +0 -4754
  66. package/dist/chunk-HDVJ5FPK.js +0 -63
  67. package/dist/chunk-IKO7JBOJ.js +0 -14788
  68. package/dist/chunk-LSCXQWNO.js +0 -822
  69. package/dist/chunk-M2VKB6RG.js +0 -146
  70. package/dist/chunk-MCED27CG.js +0 -5626
  71. package/dist/chunk-SWNRLCC6.js +0 -61
  72. package/dist/chunk-T5LLJYYS.js +0 -195
  73. package/dist/chunk-U5LTJVWL.js +0 -3185
  74. package/dist/chunk-WR7YKB6H.js +0 -44962
  75. package/dist/chunk-YC4FLMDD.js +0 -74
  76. package/dist/chunk-ZRUHMMSQ.js +0 -2477
  77. package/dist/custom-oclif-loader-5KBN3RSN.js +0 -83
  78. package/dist/del-ZCPTGWOA.js +0 -2847
  79. package/dist/devtools-5N4JAP3R.js +0 -3588
  80. package/dist/error-handler-GTW2KSRC.js +0 -35
  81. package/dist/lib-CTSCLPNV.js +0 -9
  82. package/dist/magic-string.es-ATGURXGQ.js +0 -1353
  83. package/dist/multipart-parser-KYOHF24X.js +0 -360
  84. package/dist/open-JRS7RW22.js +0 -291
  85. package/dist/out-OKI3G7I5.js +0 -6
  86. package/dist/system-4S4YXUXZ.js +0 -26
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  require_merge2,
3
3
  require_out
4
- } from "./chunk-MCED27CG.js";
4
+ } from "./chunk-ZAUZQLNO.js";
5
5
  import {
6
6
  __commonJS,
7
7
  __require,
8
8
  init_cjs_shims
9
- } from "./chunk-ZPL24Y2D.js";
9
+ } from "./chunk-POZ5MGPT.js";
10
10
 
11
11
  // ../../node_modules/.pnpm/slash@3.0.0/node_modules/slash/index.js
12
12
  var require_slash = __commonJS({
@@ -14,12 +14,8 @@ var require_slash = __commonJS({
14
14
  "use strict";
15
15
  init_cjs_shims();
16
16
  module.exports = (path) => {
17
- const isExtendedLengthPath = /^\\\\\?\\/.test(path);
18
- const hasNonAscii = /[^\u0000-\u0080]+/.test(path);
19
- if (isExtendedLengthPath || hasNonAscii) {
20
- return path;
21
- }
22
- return path.replace(/\\/g, "/");
17
+ let isExtendedLengthPath = /^\\\\\?\\/.test(path), hasNonAscii = /[^\u0000-\u0080]+/.test(path);
18
+ return isExtendedLengthPath || hasNonAscii ? path : path.replace(/\\/g, "/");
23
19
  };
24
20
  }
25
21
  });
@@ -29,9 +25,7 @@ var require_array_union = __commonJS({
29
25
  "../../node_modules/.pnpm/array-union@2.1.0/node_modules/array-union/index.js"(exports, module) {
30
26
  "use strict";
31
27
  init_cjs_shims();
32
- module.exports = (...arguments_) => {
33
- return [...new Set([].concat(...arguments_))];
34
- };
28
+ module.exports = (...arguments_) => [...new Set([].concat(...arguments_))];
35
29
  }
36
30
  });
37
31
 
@@ -40,32 +34,26 @@ var require_path_type = __commonJS({
40
34
  "../../node_modules/.pnpm/path-type@4.0.0/node_modules/path-type/index.js"(exports) {
41
35
  "use strict";
42
36
  init_cjs_shims();
43
- var { promisify } = __require("util");
44
- var fs = __require("fs");
37
+ var { promisify } = __require("util"), fs = __require("fs");
45
38
  async function isType(fsStatType, statsMethodName, filePath) {
46
- if (typeof filePath !== "string") {
39
+ if (typeof filePath != "string")
47
40
  throw new TypeError(`Expected a string, got ${typeof filePath}`);
48
- }
49
41
  try {
50
- const stats = await promisify(fs[fsStatType])(filePath);
51
- return stats[statsMethodName]();
42
+ return (await promisify(fs[fsStatType])(filePath))[statsMethodName]();
52
43
  } catch (error) {
53
- if (error.code === "ENOENT") {
54
- return false;
55
- }
44
+ if (error.code === "ENOENT")
45
+ return !1;
56
46
  throw error;
57
47
  }
58
48
  }
59
49
  function isTypeSync(fsStatType, statsMethodName, filePath) {
60
- if (typeof filePath !== "string") {
50
+ if (typeof filePath != "string")
61
51
  throw new TypeError(`Expected a string, got ${typeof filePath}`);
62
- }
63
52
  try {
64
53
  return fs[fsStatType](filePath)[statsMethodName]();
65
54
  } catch (error) {
66
- if (error.code === "ENOENT") {
67
- return false;
68
- }
55
+ if (error.code === "ENOENT")
56
+ return !1;
69
57
  throw error;
70
58
  }
71
59
  }
@@ -83,60 +71,32 @@ var require_dir_glob = __commonJS({
83
71
  "../../node_modules/.pnpm/dir-glob@3.0.1/node_modules/dir-glob/index.js"(exports, module) {
84
72
  "use strict";
85
73
  init_cjs_shims();
86
- var path = __require("path");
87
- var pathType = require_path_type();
88
- var getExtensions = (extensions) => extensions.length > 1 ? `{${extensions.join(",")}}` : extensions[0];
89
- var getPath = (filepath, cwd) => {
90
- const pth = filepath[0] === "!" ? filepath.slice(1) : filepath;
74
+ var path = __require("path"), pathType = require_path_type(), getExtensions = (extensions) => extensions.length > 1 ? `{${extensions.join(",")}}` : extensions[0], getPath = (filepath, cwd) => {
75
+ let pth = filepath[0] === "!" ? filepath.slice(1) : filepath;
91
76
  return path.isAbsolute(pth) ? pth : path.join(cwd, pth);
92
- };
93
- var addExtensions = (file, extensions) => {
94
- if (path.extname(file)) {
95
- return `**/${file}`;
96
- }
97
- return `**/${file}.${getExtensions(extensions)}`;
98
- };
99
- var getGlob = (directory, options) => {
100
- if (options.files && !Array.isArray(options.files)) {
77
+ }, addExtensions = (file, extensions) => path.extname(file) ? `**/${file}` : `**/${file}.${getExtensions(extensions)}`, getGlob = (directory, options) => {
78
+ if (options.files && !Array.isArray(options.files))
101
79
  throw new TypeError(`Expected \`files\` to be of type \`Array\` but received type \`${typeof options.files}\``);
102
- }
103
- if (options.extensions && !Array.isArray(options.extensions)) {
80
+ if (options.extensions && !Array.isArray(options.extensions))
104
81
  throw new TypeError(`Expected \`extensions\` to be of type \`Array\` but received type \`${typeof options.extensions}\``);
105
- }
106
- if (options.files && options.extensions) {
107
- return options.files.map((x) => path.posix.join(directory, addExtensions(x, options.extensions)));
108
- }
109
- if (options.files) {
110
- return options.files.map((x) => path.posix.join(directory, `**/${x}`));
111
- }
112
- if (options.extensions) {
113
- return [path.posix.join(directory, `**/*.${getExtensions(options.extensions)}`)];
114
- }
115
- return [path.posix.join(directory, "**")];
82
+ return options.files && options.extensions ? options.files.map((x) => path.posix.join(directory, addExtensions(x, options.extensions))) : options.files ? options.files.map((x) => path.posix.join(directory, `**/${x}`)) : options.extensions ? [path.posix.join(directory, `**/*.${getExtensions(options.extensions)}`)] : [path.posix.join(directory, "**")];
116
83
  };
117
84
  module.exports = async (input, options) => {
118
- options = {
85
+ if (options = {
119
86
  cwd: process.cwd(),
120
87
  ...options
121
- };
122
- if (typeof options.cwd !== "string") {
88
+ }, typeof options.cwd != "string")
123
89
  throw new TypeError(`Expected \`cwd\` to be of type \`string\` but received type \`${typeof options.cwd}\``);
124
- }
125
- const globs = await Promise.all([].concat(input).map(async (x) => {
126
- const isDirectory = await pathType.isDirectory(getPath(x, options.cwd));
127
- return isDirectory ? getGlob(x, options) : x;
128
- }));
90
+ let globs = await Promise.all([].concat(input).map(async (x) => await pathType.isDirectory(getPath(x, options.cwd)) ? getGlob(x, options) : x));
129
91
  return [].concat.apply([], globs);
130
92
  };
131
93
  module.exports.sync = (input, options) => {
132
- options = {
94
+ if (options = {
133
95
  cwd: process.cwd(),
134
96
  ...options
135
- };
136
- if (typeof options.cwd !== "string") {
97
+ }, typeof options.cwd != "string")
137
98
  throw new TypeError(`Expected \`cwd\` to be of type \`string\` but received type \`${typeof options.cwd}\``);
138
- }
139
- const globs = [].concat(input).map((x) => pathType.isDirectorySync(getPath(x, options.cwd)) ? getGlob(x, options) : x);
99
+ let globs = [].concat(input).map((x) => pathType.isDirectorySync(getPath(x, options.cwd)) ? getGlob(x, options) : x);
140
100
  return [].concat.apply([], globs);
141
101
  };
142
102
  }
@@ -149,33 +109,15 @@ var require_ignore = __commonJS({
149
109
  function makeArray(subject) {
150
110
  return Array.isArray(subject) ? subject : [subject];
151
111
  }
152
- var EMPTY = "";
153
- var SPACE = " ";
154
- var ESCAPE = "\\";
155
- var REGEX_TEST_BLANK_LINE = /^\s+$/;
156
- var REGEX_INVALID_TRAILING_BACKSLASH = /(?:[^\\]|^)\\$/;
157
- var REGEX_REPLACE_LEADING_EXCAPED_EXCLAMATION = /^\\!/;
158
- var REGEX_REPLACE_LEADING_EXCAPED_HASH = /^\\#/;
159
- var REGEX_SPLITALL_CRLF = /\r?\n/g;
160
- var REGEX_TEST_INVALID_PATH = /^\.*\/|^\.+$/;
161
- var SLASH = "/";
162
- var TMP_KEY_IGNORE = "node-ignore";
163
- if (typeof Symbol !== "undefined") {
164
- TMP_KEY_IGNORE = Symbol.for("node-ignore");
165
- }
166
- var KEY_IGNORE = TMP_KEY_IGNORE;
167
- var define = (object, key, value) => Object.defineProperty(object, key, { value });
168
- var REGEX_REGEXP_RANGE = /([0-z])-([0-z])/g;
169
- var RETURN_FALSE = () => false;
170
- var sanitizeRange = (range) => range.replace(
112
+ var EMPTY = "", SPACE = " ", ESCAPE = "\\", REGEX_TEST_BLANK_LINE = /^\s+$/, REGEX_INVALID_TRAILING_BACKSLASH = /(?:[^\\]|^)\\$/, REGEX_REPLACE_LEADING_EXCAPED_EXCLAMATION = /^\\!/, REGEX_REPLACE_LEADING_EXCAPED_HASH = /^\\#/, REGEX_SPLITALL_CRLF = /\r?\n/g, REGEX_TEST_INVALID_PATH = /^\.*\/|^\.+$/, SLASH = "/", TMP_KEY_IGNORE = "node-ignore";
113
+ typeof Symbol < "u" && (TMP_KEY_IGNORE = Symbol.for("node-ignore"));
114
+ var KEY_IGNORE = TMP_KEY_IGNORE, define = (object, key, value) => Object.defineProperty(object, key, { value }), REGEX_REGEXP_RANGE = /([0-z])-([0-z])/g, RETURN_FALSE = () => !1, sanitizeRange = (range) => range.replace(
171
115
  REGEX_REGEXP_RANGE,
172
116
  (match, from, to) => from.charCodeAt(0) <= to.charCodeAt(0) ? match : EMPTY
173
- );
174
- var cleanRangeBackSlash = (slashes) => {
175
- const { length } = slashes;
117
+ ), cleanRangeBackSlash = (slashes) => {
118
+ let { length } = slashes;
176
119
  return slashes.slice(0, length - length % 2);
177
- };
178
- var REPLACERS = [
120
+ }, REPLACERS = [
179
121
  [
180
122
  // remove BOM
181
123
  // TODO:
@@ -251,8 +193,8 @@ var require_ignore = __commonJS({
251
193
  // (which has been replaced by section "leading slash")
252
194
  // If starts with '**', adding a '^' to the regular expression also works
253
195
  /^(?=[^^])/,
254
- function startingReplacer() {
255
- return !/\/(?!$)/.test(this) ? "(?:^|\\/)" : "^";
196
+ function() {
197
+ return /\/(?!$)/.test(this) ? "^" : "(?:^|\\/)";
256
198
  }
257
199
  ],
258
200
  // two globstars
@@ -275,7 +217,7 @@ var require_ignore = __commonJS({
275
217
  // '*.js' matches '.js'
276
218
  // '*.js' doesn't match 'abc'
277
219
  (_, p1, p2) => {
278
- const unescaped = p2.replace(/\\\*/g, "[^\\/]*");
220
+ let unescaped = p2.replace(/\\\*/g, "[^\\/]*");
279
221
  return p1 + unescaped;
280
222
  }
281
223
  ],
@@ -296,7 +238,7 @@ var require_ignore = __commonJS({
296
238
  // > can be used to match one of the characters in a range.
297
239
  // `\` is escaped by step 3
298
240
  /(\\)?\[([^\]/]*?)(\\*)($|\])/g,
299
- (match, leadEscape, range, endEscape, close) => leadEscape === ESCAPE ? `\\[${range}${cleanRangeBackSlash(endEscape)}${close}` : close === "]" ? endEscape.length % 2 === 0 ? `[${sanitizeRange(range)}${endEscape}]` : "[]" : "[]"
241
+ (match, leadEscape, range, endEscape, close) => leadEscape === ESCAPE ? `\\[${range}${cleanRangeBackSlash(endEscape)}${close}` : close === "]" && endEscape.length % 2 === 0 ? `[${sanitizeRange(range)}${endEscape}]` : "[]"
300
242
  ],
301
243
  // ending
302
244
  [
@@ -318,114 +260,65 @@ var require_ignore = __commonJS({
318
260
  // trailing wildcard
319
261
  [
320
262
  /(\^|\\\/)?\\\*$/,
321
- (_, p1) => {
322
- const prefix = p1 ? `${p1}[^/]+` : "[^/]*";
323
- return `${prefix}(?=$|\\/$)`;
324
- }
263
+ (_, p1) => `${p1 ? `${p1}[^/]+` : "[^/]*"}(?=$|\\/$)`
325
264
  ]
326
- ];
327
- var regexCache = /* @__PURE__ */ Object.create(null);
328
- var makeRegex = (pattern, ignoreCase) => {
265
+ ], regexCache = /* @__PURE__ */ Object.create(null), makeRegex = (pattern, ignoreCase) => {
329
266
  let source = regexCache[pattern];
330
- if (!source) {
331
- source = REPLACERS.reduce(
332
- (prev, current) => prev.replace(current[0], current[1].bind(pattern)),
333
- pattern
334
- );
335
- regexCache[pattern] = source;
336
- }
337
- return ignoreCase ? new RegExp(source, "i") : new RegExp(source);
338
- };
339
- var isString = (subject) => typeof subject === "string";
340
- var checkPattern = (pattern) => pattern && isString(pattern) && !REGEX_TEST_BLANK_LINE.test(pattern) && !REGEX_INVALID_TRAILING_BACKSLASH.test(pattern) && pattern.indexOf("#") !== 0;
341
- var splitPattern = (pattern) => pattern.split(REGEX_SPLITALL_CRLF);
342
- var IgnoreRule = class {
267
+ return source || (source = REPLACERS.reduce(
268
+ (prev, current) => prev.replace(current[0], current[1].bind(pattern)),
269
+ pattern
270
+ ), regexCache[pattern] = source), ignoreCase ? new RegExp(source, "i") : new RegExp(source);
271
+ }, isString = (subject) => typeof subject == "string", checkPattern = (pattern) => pattern && isString(pattern) && !REGEX_TEST_BLANK_LINE.test(pattern) && !REGEX_INVALID_TRAILING_BACKSLASH.test(pattern) && pattern.indexOf("#") !== 0, splitPattern = (pattern) => pattern.split(REGEX_SPLITALL_CRLF), IgnoreRule = class {
343
272
  constructor(origin, pattern, negative, regex) {
344
- this.origin = origin;
345
- this.pattern = pattern;
346
- this.negative = negative;
347
- this.regex = regex;
348
- }
349
- };
350
- var createRule = (pattern, ignoreCase) => {
351
- const origin = pattern;
352
- let negative = false;
353
- if (pattern.indexOf("!") === 0) {
354
- negative = true;
355
- pattern = pattern.substr(1);
273
+ this.origin = origin, this.pattern = pattern, this.negative = negative, this.regex = regex;
356
274
  }
357
- pattern = pattern.replace(REGEX_REPLACE_LEADING_EXCAPED_EXCLAMATION, "!").replace(REGEX_REPLACE_LEADING_EXCAPED_HASH, "#");
358
- const regex = makeRegex(pattern, ignoreCase);
275
+ }, createRule = (pattern, ignoreCase) => {
276
+ let origin = pattern, negative = !1;
277
+ pattern.indexOf("!") === 0 && (negative = !0, pattern = pattern.substr(1)), pattern = pattern.replace(REGEX_REPLACE_LEADING_EXCAPED_EXCLAMATION, "!").replace(REGEX_REPLACE_LEADING_EXCAPED_HASH, "#");
278
+ let regex = makeRegex(pattern, ignoreCase);
359
279
  return new IgnoreRule(
360
280
  origin,
361
281
  pattern,
362
282
  negative,
363
283
  regex
364
284
  );
365
- };
366
- var throwError = (message, Ctor) => {
285
+ }, throwError = (message, Ctor) => {
367
286
  throw new Ctor(message);
368
- };
369
- var checkPath = (path, originalPath, doThrow) => {
370
- if (!isString(path)) {
371
- return doThrow(
372
- `path must be a string, but got \`${originalPath}\``,
373
- TypeError
374
- );
375
- }
376
- if (!path) {
377
- return doThrow(`path must not be empty`, TypeError);
378
- }
379
- if (checkPath.isNotRelative(path)) {
380
- const r = "`path.relative()`d";
381
- return doThrow(
382
- `path should be a ${r} string, but got "${originalPath}"`,
383
- RangeError
384
- );
385
- }
386
- return true;
387
- };
388
- var isNotRelative = (path) => REGEX_TEST_INVALID_PATH.test(path);
287
+ }, checkPath = (path, originalPath, doThrow) => isString(path) ? path ? checkPath.isNotRelative(path) ? doThrow(
288
+ `path should be a \`path.relative()\`d string, but got "${originalPath}"`,
289
+ RangeError
290
+ ) : !0 : doThrow("path must not be empty", TypeError) : doThrow(
291
+ `path must be a string, but got \`${originalPath}\``,
292
+ TypeError
293
+ ), isNotRelative = (path) => REGEX_TEST_INVALID_PATH.test(path);
389
294
  checkPath.isNotRelative = isNotRelative;
390
295
  checkPath.convert = (p) => p;
391
296
  var Ignore = class {
392
297
  constructor({
393
- ignorecase = true,
298
+ ignorecase = !0,
394
299
  ignoreCase = ignorecase,
395
- allowRelativePaths = false
300
+ allowRelativePaths = !1
396
301
  } = {}) {
397
- define(this, KEY_IGNORE, true);
398
- this._rules = [];
399
- this._ignoreCase = ignoreCase;
400
- this._allowRelativePaths = allowRelativePaths;
401
- this._initCache();
302
+ define(this, KEY_IGNORE, !0), this._rules = [], this._ignoreCase = ignoreCase, this._allowRelativePaths = allowRelativePaths, this._initCache();
402
303
  }
403
304
  _initCache() {
404
- this._ignoreCache = /* @__PURE__ */ Object.create(null);
405
- this._testCache = /* @__PURE__ */ Object.create(null);
305
+ this._ignoreCache = /* @__PURE__ */ Object.create(null), this._testCache = /* @__PURE__ */ Object.create(null);
406
306
  }
407
307
  _addPattern(pattern) {
408
308
  if (pattern && pattern[KEY_IGNORE]) {
409
- this._rules = this._rules.concat(pattern._rules);
410
- this._added = true;
309
+ this._rules = this._rules.concat(pattern._rules), this._added = !0;
411
310
  return;
412
311
  }
413
312
  if (checkPattern(pattern)) {
414
- const rule = createRule(pattern, this._ignoreCase);
415
- this._added = true;
416
- this._rules.push(rule);
313
+ let rule = createRule(pattern, this._ignoreCase);
314
+ this._added = !0, this._rules.push(rule);
417
315
  }
418
316
  }
419
317
  // @param {Array<string> | string | Ignore} pattern
420
318
  add(pattern) {
421
- this._added = false;
422
- makeArray(
319
+ return this._added = !1, makeArray(
423
320
  isString(pattern) ? splitPattern(pattern) : pattern
424
- ).forEach(this._addPattern, this);
425
- if (this._added) {
426
- this._initCache();
427
- }
428
- return this;
321
+ ).forEach(this._addPattern, this), this._added && this._initCache(), this;
429
322
  }
430
323
  // legacy
431
324
  addPattern(pattern) {
@@ -445,46 +338,32 @@ var require_ignore = __commonJS({
445
338
  // path matching.
446
339
  // @returns {TestResult} true if a file is ignored
447
340
  _testOne(path, checkUnignored) {
448
- let ignored = false;
449
- let unignored = false;
450
- this._rules.forEach((rule) => {
451
- const { negative } = rule;
452
- if (unignored === negative && ignored !== unignored || negative && !ignored && !unignored && !checkUnignored) {
341
+ let ignored = !1, unignored = !1;
342
+ return this._rules.forEach((rule) => {
343
+ let { negative } = rule;
344
+ if (unignored === negative && ignored !== unignored || negative && !ignored && !unignored && !checkUnignored)
453
345
  return;
454
- }
455
- const matched = rule.regex.test(path);
456
- if (matched) {
457
- ignored = !negative;
458
- unignored = negative;
459
- }
460
- });
461
- return {
346
+ rule.regex.test(path) && (ignored = !negative, unignored = negative);
347
+ }), {
462
348
  ignored,
463
349
  unignored
464
350
  };
465
351
  }
466
352
  // @returns {TestResult}
467
353
  _test(originalPath, cache, checkUnignored, slices) {
468
- const path = originalPath && checkPath.convert(originalPath);
469
- checkPath(
354
+ let path = originalPath && checkPath.convert(originalPath);
355
+ return checkPath(
470
356
  path,
471
357
  originalPath,
472
358
  this._allowRelativePaths ? RETURN_FALSE : throwError
473
- );
474
- return this._t(path, cache, checkUnignored, slices);
359
+ ), this._t(path, cache, checkUnignored, slices);
475
360
  }
476
361
  _t(path, cache, checkUnignored, slices) {
477
- if (path in cache) {
362
+ if (path in cache)
478
363
  return cache[path];
479
- }
480
- if (!slices) {
481
- slices = path.split(SLASH);
482
- }
483
- slices.pop();
484
- if (!slices.length) {
364
+ if (slices || (slices = path.split(SLASH)), slices.pop(), !slices.length)
485
365
  return cache[path] = this._testOne(path, checkUnignored);
486
- }
487
- const parent = this._t(
366
+ let parent = this._t(
488
367
  slices.join(SLASH) + SLASH,
489
368
  cache,
490
369
  checkUnignored,
@@ -493,7 +372,7 @@ var require_ignore = __commonJS({
493
372
  return cache[path] = parent.ignored ? parent : this._testOne(path, checkUnignored);
494
373
  }
495
374
  ignores(path) {
496
- return this._test(path, this._ignoreCache, false).ignored;
375
+ return this._test(path, this._ignoreCache, !1).ignored;
497
376
  }
498
377
  createFilter() {
499
378
  return (path) => !this.ignores(path);
@@ -503,21 +382,19 @@ var require_ignore = __commonJS({
503
382
  }
504
383
  // @returns {TestResult}
505
384
  test(path) {
506
- return this._test(path, this._testCache, true);
385
+ return this._test(path, this._testCache, !0);
507
386
  }
508
- };
509
- var factory = (options) => new Ignore(options);
510
- var isPathValid = (path) => checkPath(path && checkPath.convert(path), path, RETURN_FALSE);
387
+ }, factory = (options) => new Ignore(options), isPathValid = (path) => checkPath(path && checkPath.convert(path), path, RETURN_FALSE);
511
388
  factory.isPathValid = isPathValid;
512
389
  factory.default = factory;
513
390
  module.exports = factory;
514
391
  if (
515
392
  // Detect `process` so that it can run in browsers.
516
- typeof process !== "undefined" && (process.env && process.env.IGNORE_TEST_WIN32 || process.platform === "win32")
393
+ typeof process < "u" && (process.env && process.env.IGNORE_TEST_WIN32 || process.platform === "win32")
517
394
  ) {
518
- const makePosix = (str) => /^\\\\\?\\/.test(str) || /["<>|\u0000-\u001F]+/u.test(str) ? str : str.replace(/\\/g, "/");
395
+ let makePosix = (str) => /^\\\\\?\\/.test(str) || /["<>|\u0000-\u001F]+/u.test(str) ? str : str.replace(/\\/g, "/");
519
396
  checkPath.convert = makePosix;
520
- const REGIX_IS_WINDOWS_PATH_ABSOLUTE = /^[a-z]:\//i;
397
+ let REGIX_IS_WINDOWS_PATH_ABSOLUTE = /^[a-z]:\//i;
521
398
  checkPath.isNotRelative = (path) => REGIX_IS_WINDOWS_PATH_ABSOLUTE.test(path) || isNotRelative(path);
522
399
  }
523
400
  }
@@ -528,94 +405,61 @@ var require_gitignore = __commonJS({
528
405
  "../../node_modules/.pnpm/globby@11.1.0/node_modules/globby/gitignore.js"(exports, module) {
529
406
  "use strict";
530
407
  init_cjs_shims();
531
- var { promisify } = __require("util");
532
- var fs = __require("fs");
533
- var path = __require("path");
534
- var fastGlob = require_out();
535
- var gitIgnore = require_ignore();
536
- var slash = require_slash();
537
- var DEFAULT_IGNORE = [
408
+ var { promisify } = __require("util"), fs = __require("fs"), path = __require("path"), fastGlob = require_out(), gitIgnore = require_ignore(), slash = require_slash(), DEFAULT_IGNORE = [
538
409
  "**/node_modules/**",
539
410
  "**/flow-typed/**",
540
411
  "**/coverage/**",
541
412
  "**/.git"
542
- ];
543
- var readFileP = promisify(fs.readFile);
544
- var mapGitIgnorePatternTo = (base) => (ignore) => {
545
- if (ignore.startsWith("!")) {
546
- return "!" + path.posix.join(base, ignore.slice(1));
547
- }
548
- return path.posix.join(base, ignore);
549
- };
550
- var parseGitIgnore = (content, options) => {
551
- const base = slash(path.relative(options.cwd, path.dirname(options.fileName)));
413
+ ], readFileP = promisify(fs.readFile), mapGitIgnorePatternTo = (base) => (ignore) => ignore.startsWith("!") ? "!" + path.posix.join(base, ignore.slice(1)) : path.posix.join(base, ignore), parseGitIgnore = (content, options) => {
414
+ let base = slash(path.relative(options.cwd, path.dirname(options.fileName)));
552
415
  return content.split(/\r?\n/).filter(Boolean).filter((line) => !line.startsWith("#")).map(mapGitIgnorePatternTo(base));
553
- };
554
- var reduceIgnore = (files) => {
555
- const ignores = gitIgnore();
556
- for (const file of files) {
416
+ }, reduceIgnore = (files) => {
417
+ let ignores = gitIgnore();
418
+ for (let file of files)
557
419
  ignores.add(parseGitIgnore(file.content, {
558
420
  cwd: file.cwd,
559
421
  fileName: file.filePath
560
422
  }));
561
- }
562
423
  return ignores;
563
- };
564
- var ensureAbsolutePathForCwd = (cwd, p) => {
565
- cwd = slash(cwd);
566
- if (path.isAbsolute(p)) {
567
- if (slash(p).startsWith(cwd)) {
424
+ }, ensureAbsolutePathForCwd = (cwd, p) => {
425
+ if (cwd = slash(cwd), path.isAbsolute(p)) {
426
+ if (slash(p).startsWith(cwd))
568
427
  return p;
569
- }
570
428
  throw new Error(`Path ${p} is not in cwd ${cwd}`);
571
429
  }
572
430
  return path.join(cwd, p);
573
- };
574
- var getIsIgnoredPredecate = (ignores, cwd) => {
575
- return (p) => ignores.ignores(slash(path.relative(cwd, ensureAbsolutePathForCwd(cwd, p.path || p))));
576
- };
577
- var getFile = async (file, cwd) => {
578
- const filePath = path.join(cwd, file);
579
- const content = await readFileP(filePath, "utf8");
431
+ }, getIsIgnoredPredecate = (ignores, cwd) => (p) => ignores.ignores(slash(path.relative(cwd, ensureAbsolutePathForCwd(cwd, p.path || p)))), getFile = async (file, cwd) => {
432
+ let filePath = path.join(cwd, file), content = await readFileP(filePath, "utf8");
580
433
  return {
581
434
  cwd,
582
435
  filePath,
583
436
  content
584
437
  };
585
- };
586
- var getFileSync = (file, cwd) => {
587
- const filePath = path.join(cwd, file);
588
- const content = fs.readFileSync(filePath, "utf8");
438
+ }, getFileSync = (file, cwd) => {
439
+ let filePath = path.join(cwd, file), content = fs.readFileSync(filePath, "utf8");
589
440
  return {
590
441
  cwd,
591
442
  filePath,
592
443
  content
593
444
  };
594
- };
595
- var normalizeOptions = ({
445
+ }, normalizeOptions = ({
596
446
  ignore = [],
597
447
  cwd = slash(process.cwd())
598
- } = {}) => {
599
- return { ignore, cwd };
600
- };
448
+ } = {}) => ({ ignore, cwd });
601
449
  module.exports = async (options) => {
602
450
  options = normalizeOptions(options);
603
- const paths = await fastGlob("**/.gitignore", {
451
+ let paths = await fastGlob("**/.gitignore", {
604
452
  ignore: DEFAULT_IGNORE.concat(options.ignore),
605
453
  cwd: options.cwd
606
- });
607
- const files = await Promise.all(paths.map((file) => getFile(file, options.cwd)));
608
- const ignores = reduceIgnore(files);
454
+ }), files = await Promise.all(paths.map((file) => getFile(file, options.cwd))), ignores = reduceIgnore(files);
609
455
  return getIsIgnoredPredecate(ignores, options.cwd);
610
456
  };
611
457
  module.exports.sync = (options) => {
612
458
  options = normalizeOptions(options);
613
- const paths = fastGlob.sync("**/.gitignore", {
459
+ let files = fastGlob.sync("**/.gitignore", {
614
460
  ignore: DEFAULT_IGNORE.concat(options.ignore),
615
461
  cwd: options.cwd
616
- });
617
- const files = paths.map((file) => getFileSync(file, options.cwd));
618
- const ignores = reduceIgnore(files);
462
+ }).map((file) => getFileSync(file, options.cwd)), ignores = reduceIgnore(files);
619
463
  return getIsIgnoredPredecate(ignores, options.cwd);
620
464
  };
621
465
  }
@@ -626,37 +470,25 @@ var require_stream_utils = __commonJS({
626
470
  "../../node_modules/.pnpm/globby@11.1.0/node_modules/globby/stream-utils.js"(exports, module) {
627
471
  "use strict";
628
472
  init_cjs_shims();
629
- var { Transform } = __require("stream");
630
- var ObjectTransform = class extends Transform {
473
+ var { Transform } = __require("stream"), ObjectTransform = class extends Transform {
631
474
  constructor() {
632
475
  super({
633
- objectMode: true
476
+ objectMode: !0
634
477
  });
635
478
  }
636
- };
637
- var FilterStream = class extends ObjectTransform {
479
+ }, FilterStream = class extends ObjectTransform {
638
480
  constructor(filter) {
639
- super();
640
- this._filter = filter;
481
+ super(), this._filter = filter;
641
482
  }
642
483
  _transform(data, encoding, callback) {
643
- if (this._filter(data)) {
644
- this.push(data);
645
- }
646
- callback();
484
+ this._filter(data) && this.push(data), callback();
647
485
  }
648
- };
649
- var UniqueStream = class extends ObjectTransform {
486
+ }, UniqueStream = class extends ObjectTransform {
650
487
  constructor() {
651
- super();
652
- this._pushed = /* @__PURE__ */ new Set();
488
+ super(), this._pushed = /* @__PURE__ */ new Set();
653
489
  }
654
490
  _transform(data, encoding, callback) {
655
- if (!this._pushed.has(data)) {
656
- this.push(data);
657
- this._pushed.add(data);
658
- }
659
- callback();
491
+ this._pushed.has(data) || (this.push(data), this._pushed.add(data)), callback();
660
492
  }
661
493
  };
662
494
  module.exports = {
@@ -671,130 +503,82 @@ var require_globby = __commonJS({
671
503
  "../../node_modules/.pnpm/globby@11.1.0/node_modules/globby/index.js"(exports, module) {
672
504
  "use strict";
673
505
  init_cjs_shims();
674
- var fs = __require("fs");
675
- var arrayUnion = require_array_union();
676
- var merge2 = require_merge2();
677
- var fastGlob = require_out();
678
- var dirGlob = require_dir_glob();
679
- var gitignore = require_gitignore();
680
- var { FilterStream, UniqueStream } = require_stream_utils();
681
- var DEFAULT_FILTER = () => false;
682
- var isNegative = (pattern) => pattern[0] === "!";
683
- var assertPatternsInput = (patterns) => {
684
- if (!patterns.every((pattern) => typeof pattern === "string")) {
506
+ var fs = __require("fs"), arrayUnion = require_array_union(), merge2 = require_merge2(), fastGlob = require_out(), dirGlob = require_dir_glob(), gitignore = require_gitignore(), { FilterStream, UniqueStream } = require_stream_utils(), DEFAULT_FILTER = () => !1, isNegative = (pattern) => pattern[0] === "!", assertPatternsInput = (patterns) => {
507
+ if (!patterns.every((pattern) => typeof pattern == "string"))
685
508
  throw new TypeError("Patterns must be a string or an array of strings");
686
- }
687
- };
688
- var checkCwdOption = (options = {}) => {
689
- if (!options.cwd) {
509
+ }, checkCwdOption = (options = {}) => {
510
+ if (!options.cwd)
690
511
  return;
691
- }
692
512
  let stat;
693
513
  try {
694
514
  stat = fs.statSync(options.cwd);
695
515
  } catch {
696
516
  return;
697
517
  }
698
- if (!stat.isDirectory()) {
518
+ if (!stat.isDirectory())
699
519
  throw new Error("The `cwd` option must be a path to a directory");
700
- }
701
- };
702
- var getPathString = (p) => p.stats instanceof fs.Stats ? p.path : p;
703
- var generateGlobTasks = (patterns, taskOptions) => {
704
- patterns = arrayUnion([].concat(patterns));
705
- assertPatternsInput(patterns);
706
- checkCwdOption(taskOptions);
707
- const globTasks = [];
520
+ }, getPathString = (p) => p.stats instanceof fs.Stats ? p.path : p, generateGlobTasks = (patterns, taskOptions) => {
521
+ patterns = arrayUnion([].concat(patterns)), assertPatternsInput(patterns), checkCwdOption(taskOptions);
522
+ let globTasks = [];
708
523
  taskOptions = {
709
524
  ignore: [],
710
- expandDirectories: true,
525
+ expandDirectories: !0,
711
526
  ...taskOptions
712
527
  };
713
- for (const [index, pattern] of patterns.entries()) {
714
- if (isNegative(pattern)) {
528
+ for (let [index, pattern] of patterns.entries()) {
529
+ if (isNegative(pattern))
715
530
  continue;
716
- }
717
- const ignore = patterns.slice(index).filter((pattern2) => isNegative(pattern2)).map((pattern2) => pattern2.slice(1));
718
- const options = {
531
+ let ignore = patterns.slice(index).filter((pattern2) => isNegative(pattern2)).map((pattern2) => pattern2.slice(1)), options = {
719
532
  ...taskOptions,
720
533
  ignore: taskOptions.ignore.concat(ignore)
721
534
  };
722
535
  globTasks.push({ pattern, options });
723
536
  }
724
537
  return globTasks;
725
- };
726
- var globDirs = (task, fn) => {
538
+ }, globDirs = (task, fn) => {
727
539
  let options = {};
728
- if (task.options.cwd) {
729
- options.cwd = task.options.cwd;
730
- }
731
- if (Array.isArray(task.options.expandDirectories)) {
732
- options = {
733
- ...options,
734
- files: task.options.expandDirectories
735
- };
736
- } else if (typeof task.options.expandDirectories === "object") {
737
- options = {
738
- ...options,
739
- ...task.options.expandDirectories
740
- };
741
- }
742
- return fn(task.pattern, options);
743
- };
744
- var getPattern = (task, fn) => task.options.expandDirectories ? globDirs(task, fn) : [task.pattern];
745
- var getFilterSync = (options) => {
746
- return options && options.gitignore ? gitignore.sync({ cwd: options.cwd, ignore: options.ignore }) : DEFAULT_FILTER;
747
- };
748
- var globToTask = (task) => (glob) => {
749
- const { options } = task;
750
- if (options.ignore && Array.isArray(options.ignore) && options.expandDirectories) {
751
- options.ignore = dirGlob.sync(options.ignore);
752
- }
753
- return {
540
+ return task.options.cwd && (options.cwd = task.options.cwd), Array.isArray(task.options.expandDirectories) ? options = {
541
+ ...options,
542
+ files: task.options.expandDirectories
543
+ } : typeof task.options.expandDirectories == "object" && (options = {
544
+ ...options,
545
+ ...task.options.expandDirectories
546
+ }), fn(task.pattern, options);
547
+ }, getPattern = (task, fn) => task.options.expandDirectories ? globDirs(task, fn) : [task.pattern], getFilterSync = (options) => options && options.gitignore ? gitignore.sync({ cwd: options.cwd, ignore: options.ignore }) : DEFAULT_FILTER, globToTask = (task) => (glob) => {
548
+ let { options } = task;
549
+ return options.ignore && Array.isArray(options.ignore) && options.expandDirectories && (options.ignore = dirGlob.sync(options.ignore)), {
754
550
  pattern: glob,
755
551
  options
756
552
  };
757
553
  };
758
554
  module.exports = async (patterns, options) => {
759
- const globTasks = generateGlobTasks(patterns, options);
760
- const getFilter = async () => {
761
- return options && options.gitignore ? gitignore({ cwd: options.cwd, ignore: options.ignore }) : DEFAULT_FILTER;
762
- };
763
- const getTasks = async () => {
764
- const tasks2 = await Promise.all(globTasks.map(async (task) => {
765
- const globs = await getPattern(task, dirGlob);
555
+ let globTasks = generateGlobTasks(patterns, options), getFilter = async () => options && options.gitignore ? gitignore({ cwd: options.cwd, ignore: options.ignore }) : DEFAULT_FILTER, getTasks = async () => {
556
+ let tasks2 = await Promise.all(globTasks.map(async (task) => {
557
+ let globs = await getPattern(task, dirGlob);
766
558
  return Promise.all(globs.map(globToTask(task)));
767
559
  }));
768
560
  return arrayUnion(...tasks2);
769
- };
770
- const [filter, tasks] = await Promise.all([getFilter(), getTasks()]);
771
- const paths = await Promise.all(tasks.map((task) => fastGlob(task.pattern, task.options)));
561
+ }, [filter, tasks] = await Promise.all([getFilter(), getTasks()]), paths = await Promise.all(tasks.map((task) => fastGlob(task.pattern, task.options)));
772
562
  return arrayUnion(...paths).filter((path_) => !filter(getPathString(path_)));
773
563
  };
774
564
  module.exports.sync = (patterns, options) => {
775
- const globTasks = generateGlobTasks(patterns, options);
776
- const tasks = [];
777
- for (const task of globTasks) {
778
- const newTask = getPattern(task, dirGlob.sync).map(globToTask(task));
565
+ let globTasks = generateGlobTasks(patterns, options), tasks = [];
566
+ for (let task of globTasks) {
567
+ let newTask = getPattern(task, dirGlob.sync).map(globToTask(task));
779
568
  tasks.push(...newTask);
780
569
  }
781
- const filter = getFilterSync(options);
782
- let matches = [];
783
- for (const task of tasks) {
570
+ let filter = getFilterSync(options), matches = [];
571
+ for (let task of tasks)
784
572
  matches = arrayUnion(matches, fastGlob.sync(task.pattern, task.options));
785
- }
786
573
  return matches.filter((path_) => !filter(path_));
787
574
  };
788
575
  module.exports.stream = (patterns, options) => {
789
- const globTasks = generateGlobTasks(patterns, options);
790
- const tasks = [];
791
- for (const task of globTasks) {
792
- const newTask = getPattern(task, dirGlob.sync).map(globToTask(task));
576
+ let globTasks = generateGlobTasks(patterns, options), tasks = [];
577
+ for (let task of globTasks) {
578
+ let newTask = getPattern(task, dirGlob.sync).map(globToTask(task));
793
579
  tasks.push(...newTask);
794
580
  }
795
- const filter = getFilterSync(options);
796
- const filterStream = new FilterStream((p) => !filter(p));
797
- const uniqueStream = new UniqueStream();
581
+ let filter = getFilterSync(options), filterStream = new FilterStream((p) => !filter(p)), uniqueStream = new UniqueStream();
798
582
  return merge2(tasks.map((task) => fastGlob.stream(task.pattern, task.options))).pipe(filterStream).pipe(uniqueStream);
799
583
  };
800
584
  module.exports.generateGlobTasks = generateGlobTasks;
@@ -809,30 +593,25 @@ var require_indent_string = __commonJS({
809
593
  "use strict";
810
594
  init_cjs_shims();
811
595
  module.exports = (string, count = 1, options) => {
812
- options = {
596
+ if (options = {
813
597
  indent: " ",
814
- includeEmptyLines: false,
598
+ includeEmptyLines: !1,
815
599
  ...options
816
- };
817
- if (typeof string !== "string") {
600
+ }, typeof string != "string")
818
601
  throw new TypeError(
819
602
  `Expected \`input\` to be a \`string\`, got \`${typeof string}\``
820
603
  );
821
- }
822
- if (typeof count !== "number") {
604
+ if (typeof count != "number")
823
605
  throw new TypeError(
824
606
  `Expected \`count\` to be a \`number\`, got \`${typeof count}\``
825
607
  );
826
- }
827
- if (typeof options.indent !== "string") {
608
+ if (typeof options.indent != "string")
828
609
  throw new TypeError(
829
610
  `Expected \`options.indent\` to be a \`string\`, got \`${typeof options.indent}\``
830
611
  );
831
- }
832
- if (count === 0) {
612
+ if (count === 0)
833
613
  return string;
834
- }
835
- const regex = options.includeEmptyLines ? /^/gm : /^(?!\s*$)/gm;
614
+ let regex = options.includeEmptyLines ? /^/gm : /^(?!\s*$)/gm;
836
615
  return string.replace(regex, options.indent.repeat(count));
837
616
  };
838
617
  }
@@ -845,10 +624,7 @@ var require_balanced_match = __commonJS({
845
624
  init_cjs_shims();
846
625
  module.exports = balanced;
847
626
  function balanced(a, b, str) {
848
- if (a instanceof RegExp)
849
- a = maybeMatch(a, str);
850
- if (b instanceof RegExp)
851
- b = maybeMatch(b, str);
627
+ a instanceof RegExp && (a = maybeMatch(a, str)), b instanceof RegExp && (b = maybeMatch(b, str));
852
628
  var r = range(a, b, str);
853
629
  return r && {
854
630
  start: r[0],
@@ -864,35 +640,13 @@ var require_balanced_match = __commonJS({
864
640
  }
865
641
  balanced.range = range;
866
642
  function range(a, b, str) {
867
- var begs, beg, left, right, result;
868
- var ai = str.indexOf(a);
869
- var bi = str.indexOf(b, ai + 1);
870
- var i = ai;
643
+ var begs, beg, left, right, result, ai = str.indexOf(a), bi = str.indexOf(b, ai + 1), i = ai;
871
644
  if (ai >= 0 && bi > 0) {
872
- if (a === b) {
645
+ if (a === b)
873
646
  return [ai, bi];
874
- }
875
- begs = [];
876
- left = str.length;
877
- while (i >= 0 && !result) {
878
- if (i == ai) {
879
- begs.push(i);
880
- ai = str.indexOf(a, i + 1);
881
- } else if (begs.length == 1) {
882
- result = [begs.pop(), bi];
883
- } else {
884
- beg = begs.pop();
885
- if (beg < left) {
886
- left = beg;
887
- right = bi;
888
- }
889
- bi = str.indexOf(b, i + 1);
890
- }
891
- i = ai < bi && ai >= 0 ? ai : bi;
892
- }
893
- if (begs.length) {
894
- result = [left, right];
895
- }
647
+ for (begs = [], left = str.length; i >= 0 && !result; )
648
+ i == ai ? (begs.push(i), ai = str.indexOf(a, i + 1)) : begs.length == 1 ? result = [begs.pop(), bi] : (beg = begs.pop(), beg < left && (left = beg, right = bi), bi = str.indexOf(b, i + 1)), i = ai < bi && ai >= 0 ? ai : bi;
649
+ begs.length && (result = [left, right]);
896
650
  }
897
651
  return result;
898
652
  }
@@ -905,4 +659,4 @@ export {
905
659
  require_slash,
906
660
  require_globby
907
661
  };
908
- //# sourceMappingURL=chunk-GJPZCXGT.js.map
662
+ //# sourceMappingURL=chunk-6A7MXLVB.js.map