vitest 0.32.3 → 0.33.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.
@@ -1,7 +1,7 @@
1
1
  import { resolve as resolve$2, relative, isAbsolute, dirname, basename, normalize, join, extname, toNamespacedPath } from 'pathe';
2
2
  import { E as EXIT_CODE_RESTART, c as configFiles, d as defaultPort, a as defaultBrowserPort, w as workspacesFiles, C as CONFIG_NAMES } from './vendor-constants.538d9b49.js';
3
3
  import { g as getCoverageProvider, C as CoverageProviderMap } from './vendor-coverage.2e41927a.js';
4
- import { g as getEnvPackageName } from './vendor-environments.75f2b63d.js';
4
+ import { g as getEnvPackageName } from './vendor-environments.392ddf08.js';
5
5
  import url, { fileURLToPath, pathToFileURL } from 'node:url';
6
6
  import c from 'picocolors';
7
7
  import { isPackageExists, resolveModule } from 'local-pkg';
@@ -12,8 +12,8 @@ import path$a from 'node:path';
12
12
  import process$1 from 'node:process';
13
13
  import fs$8, { promises, existsSync, readFileSync } from 'node:fs';
14
14
  import { g as getDefaultExportFromCjs, c as commonjsGlobal } from './vendor-_commonjsHelpers.7d1333e8.js';
15
- import f$1 from 'path';
16
15
  import require$$0 from 'os';
16
+ import f$1 from 'path';
17
17
  import require$$2 from 'util';
18
18
  import require$$0$1 from 'stream';
19
19
  import require$$2$1 from 'events';
@@ -60,7 +60,7 @@ function _mergeNamespaces(n, m) {
60
60
  return Object.freeze(n);
61
61
  }
62
62
 
63
- var version$1 = "0.32.3";
63
+ var version$1 = "0.33.0";
64
64
 
65
65
  const __dirname$1 = url.fileURLToPath(new URL(".", import.meta.url));
66
66
  async function ensurePackageInstalled(dependency, root, errorMessage) {
@@ -81,7 +81,7 @@ async function ensurePackageInstalled(dependency, root, errorMessage) {
81
81
  message: c.reset(`Do you want to install ${c.green(dependency)}?`)
82
82
  });
83
83
  if (install) {
84
- await (await import('./chunk-install-pkg.0716919d.js')).installPackage(dependency, { dev: true });
84
+ await (await import('./chunk-install-pkg.23da664c.js')).installPackage(dependency, { dev: true });
85
85
  process.stderr.write(c.yellow(`
86
86
  Package ${dependency} installed, re-run the command to start.
87
87
  `));
@@ -374,92 +374,127 @@ var utils$k = {};
374
374
 
375
375
  var array$1 = {};
376
376
 
377
- Object.defineProperty(array$1, "__esModule", { value: true });
378
- array$1.splitWhen = array$1.flatten = void 0;
379
- function flatten(items) {
380
- return items.reduce((collection, item) => [].concat(collection, item), []);
381
- }
382
- array$1.flatten = flatten;
383
- function splitWhen(items, predicate) {
384
- const result = [[]];
385
- let groupIndex = 0;
386
- for (const item of items) {
387
- if (predicate(item)) {
388
- groupIndex++;
389
- result[groupIndex] = [];
390
- }
391
- else {
392
- result[groupIndex].push(item);
393
- }
394
- }
395
- return result;
396
- }
377
+ Object.defineProperty(array$1, "__esModule", { value: true });
378
+ array$1.splitWhen = array$1.flatten = void 0;
379
+ function flatten(items) {
380
+ return items.reduce((collection, item) => [].concat(collection, item), []);
381
+ }
382
+ array$1.flatten = flatten;
383
+ function splitWhen(items, predicate) {
384
+ const result = [[]];
385
+ let groupIndex = 0;
386
+ for (const item of items) {
387
+ if (predicate(item)) {
388
+ groupIndex++;
389
+ result[groupIndex] = [];
390
+ }
391
+ else {
392
+ result[groupIndex].push(item);
393
+ }
394
+ }
395
+ return result;
396
+ }
397
397
  array$1.splitWhen = splitWhen;
398
398
 
399
399
  var errno$1 = {};
400
400
 
401
- Object.defineProperty(errno$1, "__esModule", { value: true });
402
- errno$1.isEnoentCodeError = void 0;
403
- function isEnoentCodeError(error) {
404
- return error.code === 'ENOENT';
405
- }
401
+ Object.defineProperty(errno$1, "__esModule", { value: true });
402
+ errno$1.isEnoentCodeError = void 0;
403
+ function isEnoentCodeError(error) {
404
+ return error.code === 'ENOENT';
405
+ }
406
406
  errno$1.isEnoentCodeError = isEnoentCodeError;
407
407
 
408
408
  var fs$7 = {};
409
409
 
410
- Object.defineProperty(fs$7, "__esModule", { value: true });
411
- fs$7.createDirentFromStats = void 0;
412
- let DirentFromStats$1 = class DirentFromStats {
413
- constructor(name, stats) {
414
- this.name = name;
415
- this.isBlockDevice = stats.isBlockDevice.bind(stats);
416
- this.isCharacterDevice = stats.isCharacterDevice.bind(stats);
417
- this.isDirectory = stats.isDirectory.bind(stats);
418
- this.isFIFO = stats.isFIFO.bind(stats);
419
- this.isFile = stats.isFile.bind(stats);
420
- this.isSocket = stats.isSocket.bind(stats);
421
- this.isSymbolicLink = stats.isSymbolicLink.bind(stats);
422
- }
423
- };
424
- function createDirentFromStats$1(name, stats) {
425
- return new DirentFromStats$1(name, stats);
426
- }
410
+ Object.defineProperty(fs$7, "__esModule", { value: true });
411
+ fs$7.createDirentFromStats = void 0;
412
+ let DirentFromStats$1 = class DirentFromStats {
413
+ constructor(name, stats) {
414
+ this.name = name;
415
+ this.isBlockDevice = stats.isBlockDevice.bind(stats);
416
+ this.isCharacterDevice = stats.isCharacterDevice.bind(stats);
417
+ this.isDirectory = stats.isDirectory.bind(stats);
418
+ this.isFIFO = stats.isFIFO.bind(stats);
419
+ this.isFile = stats.isFile.bind(stats);
420
+ this.isSocket = stats.isSocket.bind(stats);
421
+ this.isSymbolicLink = stats.isSymbolicLink.bind(stats);
422
+ }
423
+ };
424
+ function createDirentFromStats$1(name, stats) {
425
+ return new DirentFromStats$1(name, stats);
426
+ }
427
427
  fs$7.createDirentFromStats = createDirentFromStats$1;
428
428
 
429
429
  var path$9 = {};
430
430
 
431
- Object.defineProperty(path$9, "__esModule", { value: true });
432
- path$9.removeLeadingDotSegment = path$9.escape = path$9.makeAbsolute = path$9.unixify = void 0;
433
- const path$8 = f$1;
434
- const LEADING_DOT_SEGMENT_CHARACTERS_COUNT = 2; // ./ or .\\
435
- const UNESCAPED_GLOB_SYMBOLS_RE = /(\\?)([()*?[\]{|}]|^!|[!+@](?=\())/g;
436
- /**
437
- * Designed to work only with simple paths: `dir\\file`.
438
- */
439
- function unixify(filepath) {
440
- return filepath.replace(/\\/g, '/');
441
- }
442
- path$9.unixify = unixify;
443
- function makeAbsolute(cwd, filepath) {
444
- return path$8.resolve(cwd, filepath);
445
- }
446
- path$9.makeAbsolute = makeAbsolute;
447
- function escape(pattern) {
448
- return pattern.replace(UNESCAPED_GLOB_SYMBOLS_RE, '\\$2');
449
- }
450
- path$9.escape = escape;
451
- function removeLeadingDotSegment(entry) {
452
- // We do not use `startsWith` because this is 10x slower than current implementation for some cases.
453
- // eslint-disable-next-line @typescript-eslint/prefer-string-starts-ends-with
454
- if (entry.charAt(0) === '.') {
455
- const secondCharactery = entry.charAt(1);
456
- if (secondCharactery === '/' || secondCharactery === '\\') {
457
- return entry.slice(LEADING_DOT_SEGMENT_CHARACTERS_COUNT);
458
- }
459
- }
460
- return entry;
461
- }
431
+ Object.defineProperty(path$9, "__esModule", { value: true });
432
+ path$9.convertPosixPathToPattern = path$9.convertWindowsPathToPattern = path$9.convertPathToPattern = path$9.escapePosixPath = path$9.escapeWindowsPath = path$9.escape = path$9.removeLeadingDotSegment = path$9.makeAbsolute = path$9.unixify = void 0;
433
+ const os = require$$0;
434
+ const path$8 = f$1;
435
+ const IS_WINDOWS_PLATFORM = os.platform() === 'win32';
436
+ const LEADING_DOT_SEGMENT_CHARACTERS_COUNT = 2; // ./ or .\\
437
+ /**
438
+ * All non-escaped special characters.
439
+ * Posix: ()*?[\]{|}, !+@ before (, ! at the beginning, \\ before non-special characters.
440
+ * Windows: (){}, !+@ before (, ! at the beginning.
441
+ */
442
+ const POSIX_UNESCAPED_GLOB_SYMBOLS_RE = /(\\?)([()*?[\]{|}]|^!|[!+@](?=\()|\\(?![!()*+?@[\]{|}]))/g;
443
+ const WINDOWS_UNESCAPED_GLOB_SYMBOLS_RE = /(\\?)([(){}]|^!|[!+@](?=\())/g;
444
+ /**
445
+ * The device path (\\.\ or \\?\).
446
+ * https://learn.microsoft.com/en-us/dotnet/standard/io/file-path-formats#dos-device-paths
447
+ */
448
+ const DOS_DEVICE_PATH_RE = /^\\\\([.?])/;
449
+ /**
450
+ * All backslashes except those escaping special characters.
451
+ * Windows: !()+@{}
452
+ * https://learn.microsoft.com/en-us/windows/win32/fileio/naming-a-file#naming-conventions
453
+ */
454
+ const WINDOWS_BACKSLASHES_RE = /\\(?![!()+@{}])/g;
455
+ /**
456
+ * Designed to work only with simple paths: `dir\\file`.
457
+ */
458
+ function unixify(filepath) {
459
+ return filepath.replace(/\\/g, '/');
460
+ }
461
+ path$9.unixify = unixify;
462
+ function makeAbsolute(cwd, filepath) {
463
+ return path$8.resolve(cwd, filepath);
464
+ }
465
+ path$9.makeAbsolute = makeAbsolute;
466
+ function removeLeadingDotSegment(entry) {
467
+ // We do not use `startsWith` because this is 10x slower than current implementation for some cases.
468
+ // eslint-disable-next-line @typescript-eslint/prefer-string-starts-ends-with
469
+ if (entry.charAt(0) === '.') {
470
+ const secondCharactery = entry.charAt(1);
471
+ if (secondCharactery === '/' || secondCharactery === '\\') {
472
+ return entry.slice(LEADING_DOT_SEGMENT_CHARACTERS_COUNT);
473
+ }
474
+ }
475
+ return entry;
476
+ }
462
477
  path$9.removeLeadingDotSegment = removeLeadingDotSegment;
478
+ path$9.escape = IS_WINDOWS_PLATFORM ? escapeWindowsPath : escapePosixPath;
479
+ function escapeWindowsPath(pattern) {
480
+ return pattern.replace(WINDOWS_UNESCAPED_GLOB_SYMBOLS_RE, '\\$2');
481
+ }
482
+ path$9.escapeWindowsPath = escapeWindowsPath;
483
+ function escapePosixPath(pattern) {
484
+ return pattern.replace(POSIX_UNESCAPED_GLOB_SYMBOLS_RE, '\\$2');
485
+ }
486
+ path$9.escapePosixPath = escapePosixPath;
487
+ path$9.convertPathToPattern = IS_WINDOWS_PLATFORM ? convertWindowsPathToPattern : convertPosixPathToPattern;
488
+ function convertWindowsPathToPattern(filepath) {
489
+ return escapeWindowsPath(filepath)
490
+ .replace(DOS_DEVICE_PATH_RE, '//$1')
491
+ .replace(WINDOWS_BACKSLASHES_RE, '/');
492
+ }
493
+ path$9.convertWindowsPathToPattern = convertWindowsPathToPattern;
494
+ function convertPosixPathToPattern(filepath) {
495
+ return escapePosixPath(filepath);
496
+ }
497
+ path$9.convertPosixPathToPattern = convertPosixPathToPattern;
463
498
 
464
499
  var pattern$1 = {};
465
500
 
@@ -1138,7 +1173,7 @@ const toRegexRange = toRegexRange_1;
1138
1173
 
1139
1174
  const isObject$1 = val => val !== null && typeof val === 'object' && !Array.isArray(val);
1140
1175
 
1141
- const transform$1 = toNumber => {
1176
+ const transform = toNumber => {
1142
1177
  return value => toNumber === true ? Number(value) : String(value);
1143
1178
  };
1144
1179
 
@@ -1275,7 +1310,7 @@ const fillNumbers = (start, end, step = 1, options = {}) => {
1275
1310
  let padded = zeros(startString) || zeros(endString) || zeros(stepString);
1276
1311
  let maxLen = padded ? Math.max(startString.length, endString.length, stepString.length) : 0;
1277
1312
  let toNumber = padded === false && stringify$3(start, end, options) === false;
1278
- let format = options.transform || transform$1(toNumber);
1313
+ let format = options.transform || transform(toNumber);
1279
1314
 
1280
1315
  if (options.toRegex && step === 1) {
1281
1316
  return toRange(toMaxLen(start, maxLen), toMaxLen(end, maxLen), true, options);
@@ -4633,174 +4668,193 @@ var micromatch_1 = micromatch$1;
4633
4668
 
4634
4669
  var mm = /*@__PURE__*/getDefaultExportFromCjs(micromatch_1);
4635
4670
 
4636
- Object.defineProperty(pattern$1, "__esModule", { value: true });
4637
- pattern$1.matchAny = pattern$1.convertPatternsToRe = pattern$1.makeRe = pattern$1.getPatternParts = pattern$1.expandBraceExpansion = pattern$1.expandPatternsWithBraceExpansion = pattern$1.isAffectDepthOfReadingPattern = pattern$1.endsWithSlashGlobStar = pattern$1.hasGlobStar = pattern$1.getBaseDirectory = pattern$1.isPatternRelatedToParentDirectory = pattern$1.getPatternsOutsideCurrentDirectory = pattern$1.getPatternsInsideCurrentDirectory = pattern$1.getPositivePatterns = pattern$1.getNegativePatterns = pattern$1.isPositivePattern = pattern$1.isNegativePattern = pattern$1.convertToNegativePattern = pattern$1.convertToPositivePattern = pattern$1.isDynamicPattern = pattern$1.isStaticPattern = void 0;
4638
- const path$5 = f$1;
4639
- const globParent = globParent$1;
4640
- const micromatch = micromatch_1;
4641
- const GLOBSTAR = '**';
4642
- const ESCAPE_SYMBOL = '\\';
4643
- const COMMON_GLOB_SYMBOLS_RE = /[*?]|^!/;
4644
- const REGEX_CHARACTER_CLASS_SYMBOLS_RE = /\[[^[]*]/;
4645
- const REGEX_GROUP_SYMBOLS_RE = /(?:^|[^!*+?@])\([^(]*\|[^|]*\)/;
4646
- const GLOB_EXTENSION_SYMBOLS_RE = /[!*+?@]\([^(]*\)/;
4647
- const BRACE_EXPANSION_SEPARATORS_RE = /,|\.\./;
4648
- function isStaticPattern(pattern, options = {}) {
4649
- return !isDynamicPattern(pattern, options);
4650
- }
4651
- pattern$1.isStaticPattern = isStaticPattern;
4652
- function isDynamicPattern(pattern, options = {}) {
4653
- /**
4654
- * A special case with an empty string is necessary for matching patterns that start with a forward slash.
4655
- * An empty string cannot be a dynamic pattern.
4656
- * For example, the pattern `/lib/*` will be spread into parts: '', 'lib', '*'.
4657
- */
4658
- if (pattern === '') {
4659
- return false;
4660
- }
4661
- /**
4662
- * When the `caseSensitiveMatch` option is disabled, all patterns must be marked as dynamic, because we cannot check
4663
- * filepath directly (without read directory).
4664
- */
4665
- if (options.caseSensitiveMatch === false || pattern.includes(ESCAPE_SYMBOL)) {
4666
- return true;
4667
- }
4668
- if (COMMON_GLOB_SYMBOLS_RE.test(pattern) || REGEX_CHARACTER_CLASS_SYMBOLS_RE.test(pattern) || REGEX_GROUP_SYMBOLS_RE.test(pattern)) {
4669
- return true;
4670
- }
4671
- if (options.extglob !== false && GLOB_EXTENSION_SYMBOLS_RE.test(pattern)) {
4672
- return true;
4673
- }
4674
- if (options.braceExpansion !== false && hasBraceExpansion(pattern)) {
4675
- return true;
4676
- }
4677
- return false;
4678
- }
4679
- pattern$1.isDynamicPattern = isDynamicPattern;
4680
- function hasBraceExpansion(pattern) {
4681
- const openingBraceIndex = pattern.indexOf('{');
4682
- if (openingBraceIndex === -1) {
4683
- return false;
4684
- }
4685
- const closingBraceIndex = pattern.indexOf('}', openingBraceIndex + 1);
4686
- if (closingBraceIndex === -1) {
4687
- return false;
4688
- }
4689
- const braceContent = pattern.slice(openingBraceIndex, closingBraceIndex);
4690
- return BRACE_EXPANSION_SEPARATORS_RE.test(braceContent);
4691
- }
4692
- function convertToPositivePattern(pattern) {
4693
- return isNegativePattern(pattern) ? pattern.slice(1) : pattern;
4694
- }
4695
- pattern$1.convertToPositivePattern = convertToPositivePattern;
4696
- function convertToNegativePattern(pattern) {
4697
- return '!' + pattern;
4698
- }
4699
- pattern$1.convertToNegativePattern = convertToNegativePattern;
4700
- function isNegativePattern(pattern) {
4701
- return pattern.startsWith('!') && pattern[1] !== '(';
4702
- }
4703
- pattern$1.isNegativePattern = isNegativePattern;
4704
- function isPositivePattern(pattern) {
4705
- return !isNegativePattern(pattern);
4706
- }
4707
- pattern$1.isPositivePattern = isPositivePattern;
4708
- function getNegativePatterns(patterns) {
4709
- return patterns.filter(isNegativePattern);
4710
- }
4711
- pattern$1.getNegativePatterns = getNegativePatterns;
4712
- function getPositivePatterns$1(patterns) {
4713
- return patterns.filter(isPositivePattern);
4714
- }
4715
- pattern$1.getPositivePatterns = getPositivePatterns$1;
4716
- /**
4717
- * Returns patterns that can be applied inside the current directory.
4718
- *
4719
- * @example
4720
- * // ['./*', '*', 'a/*']
4721
- * getPatternsInsideCurrentDirectory(['./*', '*', 'a/*', '../*', './../*'])
4722
- */
4723
- function getPatternsInsideCurrentDirectory(patterns) {
4724
- return patterns.filter((pattern) => !isPatternRelatedToParentDirectory(pattern));
4725
- }
4726
- pattern$1.getPatternsInsideCurrentDirectory = getPatternsInsideCurrentDirectory;
4727
- /**
4728
- * Returns patterns to be expanded relative to (outside) the current directory.
4729
- *
4730
- * @example
4731
- * // ['../*', './../*']
4732
- * getPatternsInsideCurrentDirectory(['./*', '*', 'a/*', '../*', './../*'])
4733
- */
4734
- function getPatternsOutsideCurrentDirectory(patterns) {
4735
- return patterns.filter(isPatternRelatedToParentDirectory);
4736
- }
4737
- pattern$1.getPatternsOutsideCurrentDirectory = getPatternsOutsideCurrentDirectory;
4738
- function isPatternRelatedToParentDirectory(pattern) {
4739
- return pattern.startsWith('..') || pattern.startsWith('./..');
4740
- }
4741
- pattern$1.isPatternRelatedToParentDirectory = isPatternRelatedToParentDirectory;
4742
- function getBaseDirectory(pattern) {
4743
- return globParent(pattern, { flipBackslashes: false });
4744
- }
4745
- pattern$1.getBaseDirectory = getBaseDirectory;
4746
- function hasGlobStar(pattern) {
4747
- return pattern.includes(GLOBSTAR);
4748
- }
4749
- pattern$1.hasGlobStar = hasGlobStar;
4750
- function endsWithSlashGlobStar(pattern) {
4751
- return pattern.endsWith('/' + GLOBSTAR);
4752
- }
4753
- pattern$1.endsWithSlashGlobStar = endsWithSlashGlobStar;
4754
- function isAffectDepthOfReadingPattern(pattern) {
4755
- const basename = path$5.basename(pattern);
4756
- return endsWithSlashGlobStar(pattern) || isStaticPattern(basename);
4757
- }
4758
- pattern$1.isAffectDepthOfReadingPattern = isAffectDepthOfReadingPattern;
4759
- function expandPatternsWithBraceExpansion(patterns) {
4760
- return patterns.reduce((collection, pattern) => {
4761
- return collection.concat(expandBraceExpansion(pattern));
4762
- }, []);
4763
- }
4764
- pattern$1.expandPatternsWithBraceExpansion = expandPatternsWithBraceExpansion;
4765
- function expandBraceExpansion(pattern) {
4766
- return micromatch.braces(pattern, {
4767
- expand: true,
4768
- nodupes: true
4769
- });
4770
- }
4771
- pattern$1.expandBraceExpansion = expandBraceExpansion;
4772
- function getPatternParts(pattern, options) {
4773
- let { parts } = micromatch.scan(pattern, Object.assign(Object.assign({}, options), { parts: true }));
4774
- /**
4775
- * The scan method returns an empty array in some cases.
4776
- * See micromatch/picomatch#58 for more details.
4777
- */
4778
- if (parts.length === 0) {
4779
- parts = [pattern];
4780
- }
4781
- /**
4782
- * The scan method does not return an empty part for the pattern with a forward slash.
4783
- * This is another part of micromatch/picomatch#58.
4784
- */
4785
- if (parts[0].startsWith('/')) {
4786
- parts[0] = parts[0].slice(1);
4787
- parts.unshift('');
4788
- }
4789
- return parts;
4790
- }
4791
- pattern$1.getPatternParts = getPatternParts;
4792
- function makeRe(pattern, options) {
4793
- return micromatch.makeRe(pattern, options);
4794
- }
4795
- pattern$1.makeRe = makeRe;
4796
- function convertPatternsToRe(patterns, options) {
4797
- return patterns.map((pattern) => makeRe(pattern, options));
4798
- }
4799
- pattern$1.convertPatternsToRe = convertPatternsToRe;
4800
- function matchAny(entry, patternsRe) {
4801
- return patternsRe.some((patternRe) => patternRe.test(entry));
4802
- }
4671
+ Object.defineProperty(pattern$1, "__esModule", { value: true });
4672
+ pattern$1.removeDuplicateSlashes = pattern$1.matchAny = pattern$1.convertPatternsToRe = pattern$1.makeRe = pattern$1.getPatternParts = pattern$1.expandBraceExpansion = pattern$1.expandPatternsWithBraceExpansion = pattern$1.isAffectDepthOfReadingPattern = pattern$1.endsWithSlashGlobStar = pattern$1.hasGlobStar = pattern$1.getBaseDirectory = pattern$1.isPatternRelatedToParentDirectory = pattern$1.getPatternsOutsideCurrentDirectory = pattern$1.getPatternsInsideCurrentDirectory = pattern$1.getPositivePatterns = pattern$1.getNegativePatterns = pattern$1.isPositivePattern = pattern$1.isNegativePattern = pattern$1.convertToNegativePattern = pattern$1.convertToPositivePattern = pattern$1.isDynamicPattern = pattern$1.isStaticPattern = void 0;
4673
+ const path$5 = f$1;
4674
+ const globParent = globParent$1;
4675
+ const micromatch = micromatch_1;
4676
+ const GLOBSTAR = '**';
4677
+ const ESCAPE_SYMBOL = '\\';
4678
+ const COMMON_GLOB_SYMBOLS_RE = /[*?]|^!/;
4679
+ const REGEX_CHARACTER_CLASS_SYMBOLS_RE = /\[[^[]*]/;
4680
+ const REGEX_GROUP_SYMBOLS_RE = /(?:^|[^!*+?@])\([^(]*\|[^|]*\)/;
4681
+ const GLOB_EXTENSION_SYMBOLS_RE = /[!*+?@]\([^(]*\)/;
4682
+ const BRACE_EXPANSION_SEPARATORS_RE = /,|\.\./;
4683
+ /**
4684
+ * Matches a sequence of two or more consecutive slashes, excluding the first two slashes at the beginning of the string.
4685
+ * The latter is due to the presence of the device path at the beginning of the UNC path.
4686
+ */
4687
+ const DOUBLE_SLASH_RE = /(?!^)\/{2,}/g;
4688
+ function isStaticPattern(pattern, options = {}) {
4689
+ return !isDynamicPattern(pattern, options);
4690
+ }
4691
+ pattern$1.isStaticPattern = isStaticPattern;
4692
+ function isDynamicPattern(pattern, options = {}) {
4693
+ /**
4694
+ * A special case with an empty string is necessary for matching patterns that start with a forward slash.
4695
+ * An empty string cannot be a dynamic pattern.
4696
+ * For example, the pattern `/lib/*` will be spread into parts: '', 'lib', '*'.
4697
+ */
4698
+ if (pattern === '') {
4699
+ return false;
4700
+ }
4701
+ /**
4702
+ * When the `caseSensitiveMatch` option is disabled, all patterns must be marked as dynamic, because we cannot check
4703
+ * filepath directly (without read directory).
4704
+ */
4705
+ if (options.caseSensitiveMatch === false || pattern.includes(ESCAPE_SYMBOL)) {
4706
+ return true;
4707
+ }
4708
+ if (COMMON_GLOB_SYMBOLS_RE.test(pattern) || REGEX_CHARACTER_CLASS_SYMBOLS_RE.test(pattern) || REGEX_GROUP_SYMBOLS_RE.test(pattern)) {
4709
+ return true;
4710
+ }
4711
+ if (options.extglob !== false && GLOB_EXTENSION_SYMBOLS_RE.test(pattern)) {
4712
+ return true;
4713
+ }
4714
+ if (options.braceExpansion !== false && hasBraceExpansion(pattern)) {
4715
+ return true;
4716
+ }
4717
+ return false;
4718
+ }
4719
+ pattern$1.isDynamicPattern = isDynamicPattern;
4720
+ function hasBraceExpansion(pattern) {
4721
+ const openingBraceIndex = pattern.indexOf('{');
4722
+ if (openingBraceIndex === -1) {
4723
+ return false;
4724
+ }
4725
+ const closingBraceIndex = pattern.indexOf('}', openingBraceIndex + 1);
4726
+ if (closingBraceIndex === -1) {
4727
+ return false;
4728
+ }
4729
+ const braceContent = pattern.slice(openingBraceIndex, closingBraceIndex);
4730
+ return BRACE_EXPANSION_SEPARATORS_RE.test(braceContent);
4731
+ }
4732
+ function convertToPositivePattern(pattern) {
4733
+ return isNegativePattern(pattern) ? pattern.slice(1) : pattern;
4734
+ }
4735
+ pattern$1.convertToPositivePattern = convertToPositivePattern;
4736
+ function convertToNegativePattern(pattern) {
4737
+ return '!' + pattern;
4738
+ }
4739
+ pattern$1.convertToNegativePattern = convertToNegativePattern;
4740
+ function isNegativePattern(pattern) {
4741
+ return pattern.startsWith('!') && pattern[1] !== '(';
4742
+ }
4743
+ pattern$1.isNegativePattern = isNegativePattern;
4744
+ function isPositivePattern(pattern) {
4745
+ return !isNegativePattern(pattern);
4746
+ }
4747
+ pattern$1.isPositivePattern = isPositivePattern;
4748
+ function getNegativePatterns(patterns) {
4749
+ return patterns.filter(isNegativePattern);
4750
+ }
4751
+ pattern$1.getNegativePatterns = getNegativePatterns;
4752
+ function getPositivePatterns$1(patterns) {
4753
+ return patterns.filter(isPositivePattern);
4754
+ }
4755
+ pattern$1.getPositivePatterns = getPositivePatterns$1;
4756
+ /**
4757
+ * Returns patterns that can be applied inside the current directory.
4758
+ *
4759
+ * @example
4760
+ * // ['./*', '*', 'a/*']
4761
+ * getPatternsInsideCurrentDirectory(['./*', '*', 'a/*', '../*', './../*'])
4762
+ */
4763
+ function getPatternsInsideCurrentDirectory(patterns) {
4764
+ return patterns.filter((pattern) => !isPatternRelatedToParentDirectory(pattern));
4765
+ }
4766
+ pattern$1.getPatternsInsideCurrentDirectory = getPatternsInsideCurrentDirectory;
4767
+ /**
4768
+ * Returns patterns to be expanded relative to (outside) the current directory.
4769
+ *
4770
+ * @example
4771
+ * // ['../*', './../*']
4772
+ * getPatternsInsideCurrentDirectory(['./*', '*', 'a/*', '../*', './../*'])
4773
+ */
4774
+ function getPatternsOutsideCurrentDirectory(patterns) {
4775
+ return patterns.filter(isPatternRelatedToParentDirectory);
4776
+ }
4777
+ pattern$1.getPatternsOutsideCurrentDirectory = getPatternsOutsideCurrentDirectory;
4778
+ function isPatternRelatedToParentDirectory(pattern) {
4779
+ return pattern.startsWith('..') || pattern.startsWith('./..');
4780
+ }
4781
+ pattern$1.isPatternRelatedToParentDirectory = isPatternRelatedToParentDirectory;
4782
+ function getBaseDirectory(pattern) {
4783
+ return globParent(pattern, { flipBackslashes: false });
4784
+ }
4785
+ pattern$1.getBaseDirectory = getBaseDirectory;
4786
+ function hasGlobStar(pattern) {
4787
+ return pattern.includes(GLOBSTAR);
4788
+ }
4789
+ pattern$1.hasGlobStar = hasGlobStar;
4790
+ function endsWithSlashGlobStar(pattern) {
4791
+ return pattern.endsWith('/' + GLOBSTAR);
4792
+ }
4793
+ pattern$1.endsWithSlashGlobStar = endsWithSlashGlobStar;
4794
+ function isAffectDepthOfReadingPattern(pattern) {
4795
+ const basename = path$5.basename(pattern);
4796
+ return endsWithSlashGlobStar(pattern) || isStaticPattern(basename);
4797
+ }
4798
+ pattern$1.isAffectDepthOfReadingPattern = isAffectDepthOfReadingPattern;
4799
+ function expandPatternsWithBraceExpansion(patterns) {
4800
+ return patterns.reduce((collection, pattern) => {
4801
+ return collection.concat(expandBraceExpansion(pattern));
4802
+ }, []);
4803
+ }
4804
+ pattern$1.expandPatternsWithBraceExpansion = expandPatternsWithBraceExpansion;
4805
+ function expandBraceExpansion(pattern) {
4806
+ const patterns = micromatch.braces(pattern, { expand: true, nodupes: true });
4807
+ /**
4808
+ * Sort the patterns by length so that the same depth patterns are processed side by side.
4809
+ * `a/{b,}/{c,}/*` – `['a///*', 'a/b//*', 'a//c/*', 'a/b/c/*']`
4810
+ */
4811
+ patterns.sort((a, b) => a.length - b.length);
4812
+ /**
4813
+ * Micromatch can return an empty string in the case of patterns like `{a,}`.
4814
+ */
4815
+ return patterns.filter((pattern) => pattern !== '');
4816
+ }
4817
+ pattern$1.expandBraceExpansion = expandBraceExpansion;
4818
+ function getPatternParts(pattern, options) {
4819
+ let { parts } = micromatch.scan(pattern, Object.assign(Object.assign({}, options), { parts: true }));
4820
+ /**
4821
+ * The scan method returns an empty array in some cases.
4822
+ * See micromatch/picomatch#58 for more details.
4823
+ */
4824
+ if (parts.length === 0) {
4825
+ parts = [pattern];
4826
+ }
4827
+ /**
4828
+ * The scan method does not return an empty part for the pattern with a forward slash.
4829
+ * This is another part of micromatch/picomatch#58.
4830
+ */
4831
+ if (parts[0].startsWith('/')) {
4832
+ parts[0] = parts[0].slice(1);
4833
+ parts.unshift('');
4834
+ }
4835
+ return parts;
4836
+ }
4837
+ pattern$1.getPatternParts = getPatternParts;
4838
+ function makeRe(pattern, options) {
4839
+ return micromatch.makeRe(pattern, options);
4840
+ }
4841
+ pattern$1.makeRe = makeRe;
4842
+ function convertPatternsToRe(patterns, options) {
4843
+ return patterns.map((pattern) => makeRe(pattern, options));
4844
+ }
4845
+ pattern$1.convertPatternsToRe = convertPatternsToRe;
4846
+ function matchAny(entry, patternsRe) {
4847
+ return patternsRe.some((patternRe) => patternRe.test(entry));
4848
+ }
4803
4849
  pattern$1.matchAny = matchAny;
4850
+ /**
4851
+ * This package only works with forward slashes as a path separator.
4852
+ * Because of this, we cannot use the standard `path.normalize` method, because on Windows platform it will use of backslashes.
4853
+ */
4854
+ function removeDuplicateSlashes(pattern) {
4855
+ return pattern.replace(DOUBLE_SLASH_RE, '/');
4856
+ }
4857
+ pattern$1.removeDuplicateSlashes = removeDuplicateSlashes;
4804
4858
 
4805
4859
  var stream$4 = {};
4806
4860
 
@@ -4948,156 +5002,163 @@ function pauseStreams (streams, options) {
4948
5002
  return streams
4949
5003
  }
4950
5004
 
4951
- Object.defineProperty(stream$4, "__esModule", { value: true });
4952
- stream$4.merge = void 0;
4953
- const merge2 = merge2_1;
4954
- function merge(streams) {
4955
- const mergedStream = merge2(streams);
4956
- streams.forEach((stream) => {
4957
- stream.once('error', (error) => mergedStream.emit('error', error));
4958
- });
4959
- mergedStream.once('close', () => propagateCloseEventToSources(streams));
4960
- mergedStream.once('end', () => propagateCloseEventToSources(streams));
4961
- return mergedStream;
4962
- }
4963
- stream$4.merge = merge;
4964
- function propagateCloseEventToSources(streams) {
4965
- streams.forEach((stream) => stream.emit('close'));
5005
+ Object.defineProperty(stream$4, "__esModule", { value: true });
5006
+ stream$4.merge = void 0;
5007
+ const merge2 = merge2_1;
5008
+ function merge(streams) {
5009
+ const mergedStream = merge2(streams);
5010
+ streams.forEach((stream) => {
5011
+ stream.once('error', (error) => mergedStream.emit('error', error));
5012
+ });
5013
+ mergedStream.once('close', () => propagateCloseEventToSources(streams));
5014
+ mergedStream.once('end', () => propagateCloseEventToSources(streams));
5015
+ return mergedStream;
5016
+ }
5017
+ stream$4.merge = merge;
5018
+ function propagateCloseEventToSources(streams) {
5019
+ streams.forEach((stream) => stream.emit('close'));
4966
5020
  }
4967
5021
 
4968
5022
  var string$1 = {};
4969
5023
 
4970
- Object.defineProperty(string$1, "__esModule", { value: true });
4971
- string$1.isEmpty = string$1.isString = void 0;
4972
- function isString(input) {
4973
- return typeof input === 'string';
4974
- }
4975
- string$1.isString = isString;
4976
- function isEmpty(input) {
4977
- return input === '';
4978
- }
5024
+ Object.defineProperty(string$1, "__esModule", { value: true });
5025
+ string$1.isEmpty = string$1.isString = void 0;
5026
+ function isString(input) {
5027
+ return typeof input === 'string';
5028
+ }
5029
+ string$1.isString = isString;
5030
+ function isEmpty(input) {
5031
+ return input === '';
5032
+ }
4979
5033
  string$1.isEmpty = isEmpty;
4980
5034
 
4981
- Object.defineProperty(utils$k, "__esModule", { value: true });
4982
- utils$k.string = utils$k.stream = utils$k.pattern = utils$k.path = utils$k.fs = utils$k.errno = utils$k.array = void 0;
4983
- const array = array$1;
4984
- utils$k.array = array;
4985
- const errno = errno$1;
4986
- utils$k.errno = errno;
4987
- const fs$6 = fs$7;
4988
- utils$k.fs = fs$6;
4989
- const path$4 = path$9;
4990
- utils$k.path = path$4;
4991
- const pattern = pattern$1;
4992
- utils$k.pattern = pattern;
4993
- const stream$3 = stream$4;
4994
- utils$k.stream = stream$3;
4995
- const string = string$1;
5035
+ Object.defineProperty(utils$k, "__esModule", { value: true });
5036
+ utils$k.string = utils$k.stream = utils$k.pattern = utils$k.path = utils$k.fs = utils$k.errno = utils$k.array = void 0;
5037
+ const array = array$1;
5038
+ utils$k.array = array;
5039
+ const errno = errno$1;
5040
+ utils$k.errno = errno;
5041
+ const fs$6 = fs$7;
5042
+ utils$k.fs = fs$6;
5043
+ const path$4 = path$9;
5044
+ utils$k.path = path$4;
5045
+ const pattern = pattern$1;
5046
+ utils$k.pattern = pattern;
5047
+ const stream$3 = stream$4;
5048
+ utils$k.stream = stream$3;
5049
+ const string = string$1;
4996
5050
  utils$k.string = string;
4997
5051
 
4998
- Object.defineProperty(tasks, "__esModule", { value: true });
4999
- tasks.convertPatternGroupToTask = tasks.convertPatternGroupsToTasks = tasks.groupPatternsByBaseDirectory = tasks.getNegativePatternsAsPositive = tasks.getPositivePatterns = tasks.convertPatternsToTasks = tasks.generate = void 0;
5000
- const utils$a = utils$k;
5001
- function generate(patterns, settings) {
5002
- const positivePatterns = getPositivePatterns(patterns);
5003
- const negativePatterns = getNegativePatternsAsPositive(patterns, settings.ignore);
5004
- const staticPatterns = positivePatterns.filter((pattern) => utils$a.pattern.isStaticPattern(pattern, settings));
5005
- const dynamicPatterns = positivePatterns.filter((pattern) => utils$a.pattern.isDynamicPattern(pattern, settings));
5006
- const staticTasks = convertPatternsToTasks(staticPatterns, negativePatterns, /* dynamic */ false);
5007
- const dynamicTasks = convertPatternsToTasks(dynamicPatterns, negativePatterns, /* dynamic */ true);
5008
- return staticTasks.concat(dynamicTasks);
5009
- }
5010
- tasks.generate = generate;
5011
- /**
5012
- * Returns tasks grouped by basic pattern directories.
5013
- *
5014
- * Patterns that can be found inside (`./`) and outside (`../`) the current directory are handled separately.
5015
- * This is necessary because directory traversal starts at the base directory and goes deeper.
5016
- */
5017
- function convertPatternsToTasks(positive, negative, dynamic) {
5018
- const tasks = [];
5019
- const patternsOutsideCurrentDirectory = utils$a.pattern.getPatternsOutsideCurrentDirectory(positive);
5020
- const patternsInsideCurrentDirectory = utils$a.pattern.getPatternsInsideCurrentDirectory(positive);
5021
- const outsideCurrentDirectoryGroup = groupPatternsByBaseDirectory(patternsOutsideCurrentDirectory);
5022
- const insideCurrentDirectoryGroup = groupPatternsByBaseDirectory(patternsInsideCurrentDirectory);
5023
- tasks.push(...convertPatternGroupsToTasks(outsideCurrentDirectoryGroup, negative, dynamic));
5024
- /*
5025
- * For the sake of reducing future accesses to the file system, we merge all tasks within the current directory
5026
- * into a global task, if at least one pattern refers to the root (`.`). In this case, the global task covers the rest.
5027
- */
5028
- if ('.' in insideCurrentDirectoryGroup) {
5029
- tasks.push(convertPatternGroupToTask('.', patternsInsideCurrentDirectory, negative, dynamic));
5030
- }
5031
- else {
5032
- tasks.push(...convertPatternGroupsToTasks(insideCurrentDirectoryGroup, negative, dynamic));
5033
- }
5034
- return tasks;
5035
- }
5036
- tasks.convertPatternsToTasks = convertPatternsToTasks;
5037
- function getPositivePatterns(patterns) {
5038
- return utils$a.pattern.getPositivePatterns(patterns);
5039
- }
5040
- tasks.getPositivePatterns = getPositivePatterns;
5041
- function getNegativePatternsAsPositive(patterns, ignore) {
5042
- const negative = utils$a.pattern.getNegativePatterns(patterns).concat(ignore);
5043
- const positive = negative.map(utils$a.pattern.convertToPositivePattern);
5044
- return positive;
5045
- }
5046
- tasks.getNegativePatternsAsPositive = getNegativePatternsAsPositive;
5047
- function groupPatternsByBaseDirectory(patterns) {
5048
- const group = {};
5049
- return patterns.reduce((collection, pattern) => {
5050
- const base = utils$a.pattern.getBaseDirectory(pattern);
5051
- if (base in collection) {
5052
- collection[base].push(pattern);
5053
- }
5054
- else {
5055
- collection[base] = [pattern];
5056
- }
5057
- return collection;
5058
- }, group);
5059
- }
5060
- tasks.groupPatternsByBaseDirectory = groupPatternsByBaseDirectory;
5061
- function convertPatternGroupsToTasks(positive, negative, dynamic) {
5062
- return Object.keys(positive).map((base) => {
5063
- return convertPatternGroupToTask(base, positive[base], negative, dynamic);
5064
- });
5065
- }
5066
- tasks.convertPatternGroupsToTasks = convertPatternGroupsToTasks;
5067
- function convertPatternGroupToTask(base, positive, negative, dynamic) {
5068
- return {
5069
- dynamic,
5070
- positive,
5071
- negative,
5072
- base,
5073
- patterns: [].concat(positive, negative.map(utils$a.pattern.convertToNegativePattern))
5074
- };
5075
- }
5052
+ Object.defineProperty(tasks, "__esModule", { value: true });
5053
+ tasks.convertPatternGroupToTask = tasks.convertPatternGroupsToTasks = tasks.groupPatternsByBaseDirectory = tasks.getNegativePatternsAsPositive = tasks.getPositivePatterns = tasks.convertPatternsToTasks = tasks.generate = void 0;
5054
+ const utils$a = utils$k;
5055
+ function generate(input, settings) {
5056
+ const patterns = processPatterns(input, settings);
5057
+ const ignore = processPatterns(settings.ignore, settings);
5058
+ const positivePatterns = getPositivePatterns(patterns);
5059
+ const negativePatterns = getNegativePatternsAsPositive(patterns, ignore);
5060
+ const staticPatterns = positivePatterns.filter((pattern) => utils$a.pattern.isStaticPattern(pattern, settings));
5061
+ const dynamicPatterns = positivePatterns.filter((pattern) => utils$a.pattern.isDynamicPattern(pattern, settings));
5062
+ const staticTasks = convertPatternsToTasks(staticPatterns, negativePatterns, /* dynamic */ false);
5063
+ const dynamicTasks = convertPatternsToTasks(dynamicPatterns, negativePatterns, /* dynamic */ true);
5064
+ return staticTasks.concat(dynamicTasks);
5065
+ }
5066
+ tasks.generate = generate;
5067
+ function processPatterns(input, settings) {
5068
+ let patterns = input;
5069
+ /**
5070
+ * The original pattern like `{,*,**,a/*}` can lead to problems checking the depth when matching entry
5071
+ * and some problems with the micromatch package (see fast-glob issues: #365, #394).
5072
+ *
5073
+ * To solve this problem, we expand all patterns containing brace expansion. This can lead to a slight slowdown
5074
+ * in matching in the case of a large set of patterns after expansion.
5075
+ */
5076
+ if (settings.braceExpansion) {
5077
+ patterns = utils$a.pattern.expandPatternsWithBraceExpansion(patterns);
5078
+ }
5079
+ /**
5080
+ * If the `baseNameMatch` option is enabled, we must add globstar to patterns, so that they can be used
5081
+ * at any nesting level.
5082
+ *
5083
+ * We do this here, because otherwise we have to complicate the filtering logic. For example, we need to change
5084
+ * the pattern in the filter before creating a regular expression. There is no need to change the patterns
5085
+ * in the application. Only on the input.
5086
+ */
5087
+ if (settings.baseNameMatch) {
5088
+ patterns = patterns.map((pattern) => pattern.includes('/') ? pattern : `**/${pattern}`);
5089
+ }
5090
+ /**
5091
+ * This method also removes duplicate slashes that may have been in the pattern or formed as a result of expansion.
5092
+ */
5093
+ return patterns.map((pattern) => utils$a.pattern.removeDuplicateSlashes(pattern));
5094
+ }
5095
+ /**
5096
+ * Returns tasks grouped by basic pattern directories.
5097
+ *
5098
+ * Patterns that can be found inside (`./`) and outside (`../`) the current directory are handled separately.
5099
+ * This is necessary because directory traversal starts at the base directory and goes deeper.
5100
+ */
5101
+ function convertPatternsToTasks(positive, negative, dynamic) {
5102
+ const tasks = [];
5103
+ const patternsOutsideCurrentDirectory = utils$a.pattern.getPatternsOutsideCurrentDirectory(positive);
5104
+ const patternsInsideCurrentDirectory = utils$a.pattern.getPatternsInsideCurrentDirectory(positive);
5105
+ const outsideCurrentDirectoryGroup = groupPatternsByBaseDirectory(patternsOutsideCurrentDirectory);
5106
+ const insideCurrentDirectoryGroup = groupPatternsByBaseDirectory(patternsInsideCurrentDirectory);
5107
+ tasks.push(...convertPatternGroupsToTasks(outsideCurrentDirectoryGroup, negative, dynamic));
5108
+ /*
5109
+ * For the sake of reducing future accesses to the file system, we merge all tasks within the current directory
5110
+ * into a global task, if at least one pattern refers to the root (`.`). In this case, the global task covers the rest.
5111
+ */
5112
+ if ('.' in insideCurrentDirectoryGroup) {
5113
+ tasks.push(convertPatternGroupToTask('.', patternsInsideCurrentDirectory, negative, dynamic));
5114
+ }
5115
+ else {
5116
+ tasks.push(...convertPatternGroupsToTasks(insideCurrentDirectoryGroup, negative, dynamic));
5117
+ }
5118
+ return tasks;
5119
+ }
5120
+ tasks.convertPatternsToTasks = convertPatternsToTasks;
5121
+ function getPositivePatterns(patterns) {
5122
+ return utils$a.pattern.getPositivePatterns(patterns);
5123
+ }
5124
+ tasks.getPositivePatterns = getPositivePatterns;
5125
+ function getNegativePatternsAsPositive(patterns, ignore) {
5126
+ const negative = utils$a.pattern.getNegativePatterns(patterns).concat(ignore);
5127
+ const positive = negative.map(utils$a.pattern.convertToPositivePattern);
5128
+ return positive;
5129
+ }
5130
+ tasks.getNegativePatternsAsPositive = getNegativePatternsAsPositive;
5131
+ function groupPatternsByBaseDirectory(patterns) {
5132
+ const group = {};
5133
+ return patterns.reduce((collection, pattern) => {
5134
+ const base = utils$a.pattern.getBaseDirectory(pattern);
5135
+ if (base in collection) {
5136
+ collection[base].push(pattern);
5137
+ }
5138
+ else {
5139
+ collection[base] = [pattern];
5140
+ }
5141
+ return collection;
5142
+ }, group);
5143
+ }
5144
+ tasks.groupPatternsByBaseDirectory = groupPatternsByBaseDirectory;
5145
+ function convertPatternGroupsToTasks(positive, negative, dynamic) {
5146
+ return Object.keys(positive).map((base) => {
5147
+ return convertPatternGroupToTask(base, positive[base], negative, dynamic);
5148
+ });
5149
+ }
5150
+ tasks.convertPatternGroupsToTasks = convertPatternGroupsToTasks;
5151
+ function convertPatternGroupToTask(base, positive, negative, dynamic) {
5152
+ return {
5153
+ dynamic,
5154
+ positive,
5155
+ negative,
5156
+ base,
5157
+ patterns: [].concat(positive, negative.map(utils$a.pattern.convertToNegativePattern))
5158
+ };
5159
+ }
5076
5160
  tasks.convertPatternGroupToTask = convertPatternGroupToTask;
5077
5161
 
5078
- var patterns = {};
5079
-
5080
- Object.defineProperty(patterns, "__esModule", { value: true });
5081
- patterns.removeDuplicateSlashes = patterns.transform = void 0;
5082
- /**
5083
- * Matches a sequence of two or more consecutive slashes, excluding the first two slashes at the beginning of the string.
5084
- * The latter is due to the presence of the device path at the beginning of the UNC path.
5085
- * @todo rewrite to negative lookbehind with the next major release.
5086
- */
5087
- const DOUBLE_SLASH_RE = /(?!^)\/{2,}/g;
5088
- function transform(patterns) {
5089
- return patterns.map((pattern) => removeDuplicateSlashes(pattern));
5090
- }
5091
- patterns.transform = transform;
5092
- /**
5093
- * This package only works with forward slashes as a path separator.
5094
- * Because of this, we cannot use the standard `path.normalize` method, because on Windows platform it will use of backslashes.
5095
- */
5096
- function removeDuplicateSlashes(pattern) {
5097
- return pattern.replace(DOUBLE_SLASH_RE, '/');
5098
- }
5099
- patterns.removeDuplicateSlashes = removeDuplicateSlashes;
5100
-
5101
5162
  var async$7 = {};
5102
5163
 
5103
5164
  var async$6 = {};
@@ -6271,129 +6332,129 @@ function getSettings(settingsOrOptions = {}) {
6271
6332
 
6272
6333
  var reader = {};
6273
6334
 
6274
- Object.defineProperty(reader, "__esModule", { value: true });
6275
- const path$1 = f$1;
6276
- const fsStat$2 = out$1;
6277
- const utils$6 = utils$k;
6278
- class Reader {
6279
- constructor(_settings) {
6280
- this._settings = _settings;
6281
- this._fsStatSettings = new fsStat$2.Settings({
6282
- followSymbolicLink: this._settings.followSymbolicLinks,
6283
- fs: this._settings.fs,
6284
- throwErrorOnBrokenSymbolicLink: this._settings.followSymbolicLinks
6285
- });
6286
- }
6287
- _getFullEntryPath(filepath) {
6288
- return path$1.resolve(this._settings.cwd, filepath);
6289
- }
6290
- _makeEntry(stats, pattern) {
6291
- const entry = {
6292
- name: pattern,
6293
- path: pattern,
6294
- dirent: utils$6.fs.createDirentFromStats(pattern, stats)
6295
- };
6296
- if (this._settings.stats) {
6297
- entry.stats = stats;
6298
- }
6299
- return entry;
6300
- }
6301
- _isFatalError(error) {
6302
- return !utils$6.errno.isEnoentCodeError(error) && !this._settings.suppressErrors;
6303
- }
6304
- }
6335
+ Object.defineProperty(reader, "__esModule", { value: true });
6336
+ const path$1 = f$1;
6337
+ const fsStat$2 = out$1;
6338
+ const utils$6 = utils$k;
6339
+ class Reader {
6340
+ constructor(_settings) {
6341
+ this._settings = _settings;
6342
+ this._fsStatSettings = new fsStat$2.Settings({
6343
+ followSymbolicLink: this._settings.followSymbolicLinks,
6344
+ fs: this._settings.fs,
6345
+ throwErrorOnBrokenSymbolicLink: this._settings.followSymbolicLinks
6346
+ });
6347
+ }
6348
+ _getFullEntryPath(filepath) {
6349
+ return path$1.resolve(this._settings.cwd, filepath);
6350
+ }
6351
+ _makeEntry(stats, pattern) {
6352
+ const entry = {
6353
+ name: pattern,
6354
+ path: pattern,
6355
+ dirent: utils$6.fs.createDirentFromStats(pattern, stats)
6356
+ };
6357
+ if (this._settings.stats) {
6358
+ entry.stats = stats;
6359
+ }
6360
+ return entry;
6361
+ }
6362
+ _isFatalError(error) {
6363
+ return !utils$6.errno.isEnoentCodeError(error) && !this._settings.suppressErrors;
6364
+ }
6365
+ }
6305
6366
  reader.default = Reader;
6306
6367
 
6307
6368
  var stream$1 = {};
6308
6369
 
6309
- Object.defineProperty(stream$1, "__esModule", { value: true });
6310
- const stream_1$3 = require$$0$1;
6311
- const fsStat$1 = out$1;
6312
- const fsWalk$2 = out$3;
6313
- const reader_1$2 = reader;
6314
- class ReaderStream extends reader_1$2.default {
6315
- constructor() {
6316
- super(...arguments);
6317
- this._walkStream = fsWalk$2.walkStream;
6318
- this._stat = fsStat$1.stat;
6319
- }
6320
- dynamic(root, options) {
6321
- return this._walkStream(root, options);
6322
- }
6323
- static(patterns, options) {
6324
- const filepaths = patterns.map(this._getFullEntryPath, this);
6325
- const stream = new stream_1$3.PassThrough({ objectMode: true });
6326
- stream._write = (index, _enc, done) => {
6327
- return this._getEntry(filepaths[index], patterns[index], options)
6328
- .then((entry) => {
6329
- if (entry !== null && options.entryFilter(entry)) {
6330
- stream.push(entry);
6331
- }
6332
- if (index === filepaths.length - 1) {
6333
- stream.end();
6334
- }
6335
- done();
6336
- })
6337
- .catch(done);
6338
- };
6339
- for (let i = 0; i < filepaths.length; i++) {
6340
- stream.write(i);
6341
- }
6342
- return stream;
6343
- }
6344
- _getEntry(filepath, pattern, options) {
6345
- return this._getStat(filepath)
6346
- .then((stats) => this._makeEntry(stats, pattern))
6347
- .catch((error) => {
6348
- if (options.errorFilter(error)) {
6349
- return null;
6350
- }
6351
- throw error;
6352
- });
6353
- }
6354
- _getStat(filepath) {
6355
- return new Promise((resolve, reject) => {
6356
- this._stat(filepath, this._fsStatSettings, (error, stats) => {
6357
- return error === null ? resolve(stats) : reject(error);
6358
- });
6359
- });
6360
- }
6361
- }
6370
+ Object.defineProperty(stream$1, "__esModule", { value: true });
6371
+ const stream_1$3 = require$$0$1;
6372
+ const fsStat$1 = out$1;
6373
+ const fsWalk$2 = out$3;
6374
+ const reader_1$2 = reader;
6375
+ class ReaderStream extends reader_1$2.default {
6376
+ constructor() {
6377
+ super(...arguments);
6378
+ this._walkStream = fsWalk$2.walkStream;
6379
+ this._stat = fsStat$1.stat;
6380
+ }
6381
+ dynamic(root, options) {
6382
+ return this._walkStream(root, options);
6383
+ }
6384
+ static(patterns, options) {
6385
+ const filepaths = patterns.map(this._getFullEntryPath, this);
6386
+ const stream = new stream_1$3.PassThrough({ objectMode: true });
6387
+ stream._write = (index, _enc, done) => {
6388
+ return this._getEntry(filepaths[index], patterns[index], options)
6389
+ .then((entry) => {
6390
+ if (entry !== null && options.entryFilter(entry)) {
6391
+ stream.push(entry);
6392
+ }
6393
+ if (index === filepaths.length - 1) {
6394
+ stream.end();
6395
+ }
6396
+ done();
6397
+ })
6398
+ .catch(done);
6399
+ };
6400
+ for (let i = 0; i < filepaths.length; i++) {
6401
+ stream.write(i);
6402
+ }
6403
+ return stream;
6404
+ }
6405
+ _getEntry(filepath, pattern, options) {
6406
+ return this._getStat(filepath)
6407
+ .then((stats) => this._makeEntry(stats, pattern))
6408
+ .catch((error) => {
6409
+ if (options.errorFilter(error)) {
6410
+ return null;
6411
+ }
6412
+ throw error;
6413
+ });
6414
+ }
6415
+ _getStat(filepath) {
6416
+ return new Promise((resolve, reject) => {
6417
+ this._stat(filepath, this._fsStatSettings, (error, stats) => {
6418
+ return error === null ? resolve(stats) : reject(error);
6419
+ });
6420
+ });
6421
+ }
6422
+ }
6362
6423
  stream$1.default = ReaderStream;
6363
6424
 
6364
- Object.defineProperty(async$6, "__esModule", { value: true });
6365
- const fsWalk$1 = out$3;
6366
- const reader_1$1 = reader;
6367
- const stream_1$2 = stream$1;
6368
- class ReaderAsync extends reader_1$1.default {
6369
- constructor() {
6370
- super(...arguments);
6371
- this._walkAsync = fsWalk$1.walk;
6372
- this._readerStream = new stream_1$2.default(this._settings);
6373
- }
6374
- dynamic(root, options) {
6375
- return new Promise((resolve, reject) => {
6376
- this._walkAsync(root, options, (error, entries) => {
6377
- if (error === null) {
6378
- resolve(entries);
6379
- }
6380
- else {
6381
- reject(error);
6382
- }
6383
- });
6384
- });
6385
- }
6386
- async static(patterns, options) {
6387
- const entries = [];
6388
- const stream = this._readerStream.static(patterns, options);
6389
- // After #235, replace it with an asynchronous iterator.
6390
- return new Promise((resolve, reject) => {
6391
- stream.once('error', reject);
6392
- stream.on('data', (entry) => entries.push(entry));
6393
- stream.once('end', () => resolve(entries));
6394
- });
6395
- }
6396
- }
6425
+ Object.defineProperty(async$6, "__esModule", { value: true });
6426
+ const fsWalk$1 = out$3;
6427
+ const reader_1$1 = reader;
6428
+ const stream_1$2 = stream$1;
6429
+ class ReaderAsync extends reader_1$1.default {
6430
+ constructor() {
6431
+ super(...arguments);
6432
+ this._walkAsync = fsWalk$1.walk;
6433
+ this._readerStream = new stream_1$2.default(this._settings);
6434
+ }
6435
+ dynamic(root, options) {
6436
+ return new Promise((resolve, reject) => {
6437
+ this._walkAsync(root, options, (error, entries) => {
6438
+ if (error === null) {
6439
+ resolve(entries);
6440
+ }
6441
+ else {
6442
+ reject(error);
6443
+ }
6444
+ });
6445
+ });
6446
+ }
6447
+ async static(patterns, options) {
6448
+ const entries = [];
6449
+ const stream = this._readerStream.static(patterns, options);
6450
+ // After #235, replace it with an asynchronous iterator.
6451
+ return new Promise((resolve, reject) => {
6452
+ stream.once('error', reject);
6453
+ stream.on('data', (entry) => entries.push(entry));
6454
+ stream.once('end', () => resolve(entries));
6455
+ });
6456
+ }
6457
+ }
6397
6458
  async$6.default = ReaderAsync;
6398
6459
 
6399
6460
  var provider = {};
@@ -6404,568 +6465,594 @@ var partial = {};
6404
6465
 
6405
6466
  var matcher = {};
6406
6467
 
6407
- Object.defineProperty(matcher, "__esModule", { value: true });
6408
- const utils$5 = utils$k;
6409
- class Matcher {
6410
- constructor(_patterns, _settings, _micromatchOptions) {
6411
- this._patterns = _patterns;
6412
- this._settings = _settings;
6413
- this._micromatchOptions = _micromatchOptions;
6414
- this._storage = [];
6415
- this._fillStorage();
6416
- }
6417
- _fillStorage() {
6418
- /**
6419
- * The original pattern may include `{,*,**,a/*}`, which will lead to problems with matching (unresolved level).
6420
- * So, before expand patterns with brace expansion into separated patterns.
6421
- */
6422
- const patterns = utils$5.pattern.expandPatternsWithBraceExpansion(this._patterns);
6423
- for (const pattern of patterns) {
6424
- const segments = this._getPatternSegments(pattern);
6425
- const sections = this._splitSegmentsIntoSections(segments);
6426
- this._storage.push({
6427
- complete: sections.length <= 1,
6428
- pattern,
6429
- segments,
6430
- sections
6431
- });
6432
- }
6433
- }
6434
- _getPatternSegments(pattern) {
6435
- const parts = utils$5.pattern.getPatternParts(pattern, this._micromatchOptions);
6436
- return parts.map((part) => {
6437
- const dynamic = utils$5.pattern.isDynamicPattern(part, this._settings);
6438
- if (!dynamic) {
6439
- return {
6440
- dynamic: false,
6441
- pattern: part
6442
- };
6443
- }
6444
- return {
6445
- dynamic: true,
6446
- pattern: part,
6447
- patternRe: utils$5.pattern.makeRe(part, this._micromatchOptions)
6448
- };
6449
- });
6450
- }
6451
- _splitSegmentsIntoSections(segments) {
6452
- return utils$5.array.splitWhen(segments, (segment) => segment.dynamic && utils$5.pattern.hasGlobStar(segment.pattern));
6453
- }
6454
- }
6468
+ Object.defineProperty(matcher, "__esModule", { value: true });
6469
+ const utils$5 = utils$k;
6470
+ class Matcher {
6471
+ constructor(_patterns, _settings, _micromatchOptions) {
6472
+ this._patterns = _patterns;
6473
+ this._settings = _settings;
6474
+ this._micromatchOptions = _micromatchOptions;
6475
+ this._storage = [];
6476
+ this._fillStorage();
6477
+ }
6478
+ _fillStorage() {
6479
+ for (const pattern of this._patterns) {
6480
+ const segments = this._getPatternSegments(pattern);
6481
+ const sections = this._splitSegmentsIntoSections(segments);
6482
+ this._storage.push({
6483
+ complete: sections.length <= 1,
6484
+ pattern,
6485
+ segments,
6486
+ sections
6487
+ });
6488
+ }
6489
+ }
6490
+ _getPatternSegments(pattern) {
6491
+ const parts = utils$5.pattern.getPatternParts(pattern, this._micromatchOptions);
6492
+ return parts.map((part) => {
6493
+ const dynamic = utils$5.pattern.isDynamicPattern(part, this._settings);
6494
+ if (!dynamic) {
6495
+ return {
6496
+ dynamic: false,
6497
+ pattern: part
6498
+ };
6499
+ }
6500
+ return {
6501
+ dynamic: true,
6502
+ pattern: part,
6503
+ patternRe: utils$5.pattern.makeRe(part, this._micromatchOptions)
6504
+ };
6505
+ });
6506
+ }
6507
+ _splitSegmentsIntoSections(segments) {
6508
+ return utils$5.array.splitWhen(segments, (segment) => segment.dynamic && utils$5.pattern.hasGlobStar(segment.pattern));
6509
+ }
6510
+ }
6455
6511
  matcher.default = Matcher;
6456
6512
 
6457
- Object.defineProperty(partial, "__esModule", { value: true });
6458
- const matcher_1 = matcher;
6459
- class PartialMatcher extends matcher_1.default {
6460
- match(filepath) {
6461
- const parts = filepath.split('/');
6462
- const levels = parts.length;
6463
- const patterns = this._storage.filter((info) => !info.complete || info.segments.length > levels);
6464
- for (const pattern of patterns) {
6465
- const section = pattern.sections[0];
6466
- /**
6467
- * In this case, the pattern has a globstar and we must read all directories unconditionally,
6468
- * but only if the level has reached the end of the first group.
6469
- *
6470
- * fixtures/{a,b}/**
6471
- * ^ true/false ^ always true
6472
- */
6473
- if (!pattern.complete && levels > section.length) {
6474
- return true;
6475
- }
6476
- const match = parts.every((part, index) => {
6477
- const segment = pattern.segments[index];
6478
- if (segment.dynamic && segment.patternRe.test(part)) {
6479
- return true;
6480
- }
6481
- if (!segment.dynamic && segment.pattern === part) {
6482
- return true;
6483
- }
6484
- return false;
6485
- });
6486
- if (match) {
6487
- return true;
6488
- }
6489
- }
6490
- return false;
6491
- }
6492
- }
6513
+ Object.defineProperty(partial, "__esModule", { value: true });
6514
+ const matcher_1 = matcher;
6515
+ class PartialMatcher extends matcher_1.default {
6516
+ match(filepath) {
6517
+ const parts = filepath.split('/');
6518
+ const levels = parts.length;
6519
+ const patterns = this._storage.filter((info) => !info.complete || info.segments.length > levels);
6520
+ for (const pattern of patterns) {
6521
+ const section = pattern.sections[0];
6522
+ /**
6523
+ * In this case, the pattern has a globstar and we must read all directories unconditionally,
6524
+ * but only if the level has reached the end of the first group.
6525
+ *
6526
+ * fixtures/{a,b}/**
6527
+ * ^ true/false ^ always true
6528
+ */
6529
+ if (!pattern.complete && levels > section.length) {
6530
+ return true;
6531
+ }
6532
+ const match = parts.every((part, index) => {
6533
+ const segment = pattern.segments[index];
6534
+ if (segment.dynamic && segment.patternRe.test(part)) {
6535
+ return true;
6536
+ }
6537
+ if (!segment.dynamic && segment.pattern === part) {
6538
+ return true;
6539
+ }
6540
+ return false;
6541
+ });
6542
+ if (match) {
6543
+ return true;
6544
+ }
6545
+ }
6546
+ return false;
6547
+ }
6548
+ }
6493
6549
  partial.default = PartialMatcher;
6494
6550
 
6495
- Object.defineProperty(deep, "__esModule", { value: true });
6496
- const utils$4 = utils$k;
6497
- const partial_1 = partial;
6498
- class DeepFilter {
6499
- constructor(_settings, _micromatchOptions) {
6500
- this._settings = _settings;
6501
- this._micromatchOptions = _micromatchOptions;
6502
- }
6503
- getFilter(basePath, positive, negative) {
6504
- const matcher = this._getMatcher(positive);
6505
- const negativeRe = this._getNegativePatternsRe(negative);
6506
- return (entry) => this._filter(basePath, entry, matcher, negativeRe);
6507
- }
6508
- _getMatcher(patterns) {
6509
- return new partial_1.default(patterns, this._settings, this._micromatchOptions);
6510
- }
6511
- _getNegativePatternsRe(patterns) {
6512
- const affectDepthOfReadingPatterns = patterns.filter(utils$4.pattern.isAffectDepthOfReadingPattern);
6513
- return utils$4.pattern.convertPatternsToRe(affectDepthOfReadingPatterns, this._micromatchOptions);
6514
- }
6515
- _filter(basePath, entry, matcher, negativeRe) {
6516
- if (this._isSkippedByDeep(basePath, entry.path)) {
6517
- return false;
6518
- }
6519
- if (this._isSkippedSymbolicLink(entry)) {
6520
- return false;
6521
- }
6522
- const filepath = utils$4.path.removeLeadingDotSegment(entry.path);
6523
- if (this._isSkippedByPositivePatterns(filepath, matcher)) {
6524
- return false;
6525
- }
6526
- return this._isSkippedByNegativePatterns(filepath, negativeRe);
6527
- }
6528
- _isSkippedByDeep(basePath, entryPath) {
6529
- /**
6530
- * Avoid unnecessary depth calculations when it doesn't matter.
6531
- */
6532
- if (this._settings.deep === Infinity) {
6533
- return false;
6534
- }
6535
- return this._getEntryLevel(basePath, entryPath) >= this._settings.deep;
6536
- }
6537
- _getEntryLevel(basePath, entryPath) {
6538
- const entryPathDepth = entryPath.split('/').length;
6539
- if (basePath === '') {
6540
- return entryPathDepth;
6541
- }
6542
- const basePathDepth = basePath.split('/').length;
6543
- return entryPathDepth - basePathDepth;
6544
- }
6545
- _isSkippedSymbolicLink(entry) {
6546
- return !this._settings.followSymbolicLinks && entry.dirent.isSymbolicLink();
6547
- }
6548
- _isSkippedByPositivePatterns(entryPath, matcher) {
6549
- return !this._settings.baseNameMatch && !matcher.match(entryPath);
6550
- }
6551
- _isSkippedByNegativePatterns(entryPath, patternsRe) {
6552
- return !utils$4.pattern.matchAny(entryPath, patternsRe);
6553
- }
6554
- }
6551
+ Object.defineProperty(deep, "__esModule", { value: true });
6552
+ const utils$4 = utils$k;
6553
+ const partial_1 = partial;
6554
+ class DeepFilter {
6555
+ constructor(_settings, _micromatchOptions) {
6556
+ this._settings = _settings;
6557
+ this._micromatchOptions = _micromatchOptions;
6558
+ }
6559
+ getFilter(basePath, positive, negative) {
6560
+ const matcher = this._getMatcher(positive);
6561
+ const negativeRe = this._getNegativePatternsRe(negative);
6562
+ return (entry) => this._filter(basePath, entry, matcher, negativeRe);
6563
+ }
6564
+ _getMatcher(patterns) {
6565
+ return new partial_1.default(patterns, this._settings, this._micromatchOptions);
6566
+ }
6567
+ _getNegativePatternsRe(patterns) {
6568
+ const affectDepthOfReadingPatterns = patterns.filter(utils$4.pattern.isAffectDepthOfReadingPattern);
6569
+ return utils$4.pattern.convertPatternsToRe(affectDepthOfReadingPatterns, this._micromatchOptions);
6570
+ }
6571
+ _filter(basePath, entry, matcher, negativeRe) {
6572
+ if (this._isSkippedByDeep(basePath, entry.path)) {
6573
+ return false;
6574
+ }
6575
+ if (this._isSkippedSymbolicLink(entry)) {
6576
+ return false;
6577
+ }
6578
+ const filepath = utils$4.path.removeLeadingDotSegment(entry.path);
6579
+ if (this._isSkippedByPositivePatterns(filepath, matcher)) {
6580
+ return false;
6581
+ }
6582
+ return this._isSkippedByNegativePatterns(filepath, negativeRe);
6583
+ }
6584
+ _isSkippedByDeep(basePath, entryPath) {
6585
+ /**
6586
+ * Avoid unnecessary depth calculations when it doesn't matter.
6587
+ */
6588
+ if (this._settings.deep === Infinity) {
6589
+ return false;
6590
+ }
6591
+ return this._getEntryLevel(basePath, entryPath) >= this._settings.deep;
6592
+ }
6593
+ _getEntryLevel(basePath, entryPath) {
6594
+ const entryPathDepth = entryPath.split('/').length;
6595
+ if (basePath === '') {
6596
+ return entryPathDepth;
6597
+ }
6598
+ const basePathDepth = basePath.split('/').length;
6599
+ return entryPathDepth - basePathDepth;
6600
+ }
6601
+ _isSkippedSymbolicLink(entry) {
6602
+ return !this._settings.followSymbolicLinks && entry.dirent.isSymbolicLink();
6603
+ }
6604
+ _isSkippedByPositivePatterns(entryPath, matcher) {
6605
+ return !this._settings.baseNameMatch && !matcher.match(entryPath);
6606
+ }
6607
+ _isSkippedByNegativePatterns(entryPath, patternsRe) {
6608
+ return !utils$4.pattern.matchAny(entryPath, patternsRe);
6609
+ }
6610
+ }
6555
6611
  deep.default = DeepFilter;
6556
6612
 
6557
6613
  var entry$1 = {};
6558
6614
 
6559
- Object.defineProperty(entry$1, "__esModule", { value: true });
6560
- const utils$3 = utils$k;
6561
- class EntryFilter {
6562
- constructor(_settings, _micromatchOptions) {
6563
- this._settings = _settings;
6564
- this._micromatchOptions = _micromatchOptions;
6565
- this.index = new Map();
6566
- }
6567
- getFilter(positive, negative) {
6568
- const positiveRe = utils$3.pattern.convertPatternsToRe(positive, this._micromatchOptions);
6569
- const negativeRe = utils$3.pattern.convertPatternsToRe(negative, this._micromatchOptions);
6570
- return (entry) => this._filter(entry, positiveRe, negativeRe);
6571
- }
6572
- _filter(entry, positiveRe, negativeRe) {
6573
- if (this._settings.unique && this._isDuplicateEntry(entry)) {
6574
- return false;
6575
- }
6576
- if (this._onlyFileFilter(entry) || this._onlyDirectoryFilter(entry)) {
6577
- return false;
6578
- }
6579
- if (this._isSkippedByAbsoluteNegativePatterns(entry.path, negativeRe)) {
6580
- return false;
6581
- }
6582
- const filepath = this._settings.baseNameMatch ? entry.name : entry.path;
6583
- const isDirectory = entry.dirent.isDirectory();
6584
- const isMatched = this._isMatchToPatterns(filepath, positiveRe, isDirectory) && !this._isMatchToPatterns(entry.path, negativeRe, isDirectory);
6585
- if (this._settings.unique && isMatched) {
6586
- this._createIndexRecord(entry);
6587
- }
6588
- return isMatched;
6589
- }
6590
- _isDuplicateEntry(entry) {
6591
- return this.index.has(entry.path);
6592
- }
6593
- _createIndexRecord(entry) {
6594
- this.index.set(entry.path, undefined);
6595
- }
6596
- _onlyFileFilter(entry) {
6597
- return this._settings.onlyFiles && !entry.dirent.isFile();
6598
- }
6599
- _onlyDirectoryFilter(entry) {
6600
- return this._settings.onlyDirectories && !entry.dirent.isDirectory();
6601
- }
6602
- _isSkippedByAbsoluteNegativePatterns(entryPath, patternsRe) {
6603
- if (!this._settings.absolute) {
6604
- return false;
6605
- }
6606
- const fullpath = utils$3.path.makeAbsolute(this._settings.cwd, entryPath);
6607
- return utils$3.pattern.matchAny(fullpath, patternsRe);
6608
- }
6609
- _isMatchToPatterns(entryPath, patternsRe, isDirectory) {
6610
- const filepath = utils$3.path.removeLeadingDotSegment(entryPath);
6611
- // Trying to match files and directories by patterns.
6612
- const isMatched = utils$3.pattern.matchAny(filepath, patternsRe);
6613
- // A pattern with a trailling slash can be used for directory matching.
6614
- // To apply such pattern, we need to add a tralling slash to the path.
6615
- if (!isMatched && isDirectory) {
6616
- return utils$3.pattern.matchAny(filepath + '/', patternsRe);
6617
- }
6618
- return isMatched;
6619
- }
6620
- }
6615
+ Object.defineProperty(entry$1, "__esModule", { value: true });
6616
+ const utils$3 = utils$k;
6617
+ class EntryFilter {
6618
+ constructor(_settings, _micromatchOptions) {
6619
+ this._settings = _settings;
6620
+ this._micromatchOptions = _micromatchOptions;
6621
+ this.index = new Map();
6622
+ }
6623
+ getFilter(positive, negative) {
6624
+ const positiveRe = utils$3.pattern.convertPatternsToRe(positive, this._micromatchOptions);
6625
+ const negativeRe = utils$3.pattern.convertPatternsToRe(negative, Object.assign(Object.assign({}, this._micromatchOptions), { dot: true }));
6626
+ return (entry) => this._filter(entry, positiveRe, negativeRe);
6627
+ }
6628
+ _filter(entry, positiveRe, negativeRe) {
6629
+ const filepath = utils$3.path.removeLeadingDotSegment(entry.path);
6630
+ if (this._settings.unique && this._isDuplicateEntry(filepath)) {
6631
+ return false;
6632
+ }
6633
+ if (this._onlyFileFilter(entry) || this._onlyDirectoryFilter(entry)) {
6634
+ return false;
6635
+ }
6636
+ if (this._isSkippedByAbsoluteNegativePatterns(filepath, negativeRe)) {
6637
+ return false;
6638
+ }
6639
+ const isDirectory = entry.dirent.isDirectory();
6640
+ const isMatched = this._isMatchToPatterns(filepath, positiveRe, isDirectory) && !this._isMatchToPatterns(filepath, negativeRe, isDirectory);
6641
+ if (this._settings.unique && isMatched) {
6642
+ this._createIndexRecord(filepath);
6643
+ }
6644
+ return isMatched;
6645
+ }
6646
+ _isDuplicateEntry(filepath) {
6647
+ return this.index.has(filepath);
6648
+ }
6649
+ _createIndexRecord(filepath) {
6650
+ this.index.set(filepath, undefined);
6651
+ }
6652
+ _onlyFileFilter(entry) {
6653
+ return this._settings.onlyFiles && !entry.dirent.isFile();
6654
+ }
6655
+ _onlyDirectoryFilter(entry) {
6656
+ return this._settings.onlyDirectories && !entry.dirent.isDirectory();
6657
+ }
6658
+ _isSkippedByAbsoluteNegativePatterns(entryPath, patternsRe) {
6659
+ if (!this._settings.absolute) {
6660
+ return false;
6661
+ }
6662
+ const fullpath = utils$3.path.makeAbsolute(this._settings.cwd, entryPath);
6663
+ return utils$3.pattern.matchAny(fullpath, patternsRe);
6664
+ }
6665
+ _isMatchToPatterns(filepath, patternsRe, isDirectory) {
6666
+ // Trying to match files and directories by patterns.
6667
+ const isMatched = utils$3.pattern.matchAny(filepath, patternsRe);
6668
+ // A pattern with a trailling slash can be used for directory matching.
6669
+ // To apply such pattern, we need to add a tralling slash to the path.
6670
+ if (!isMatched && isDirectory) {
6671
+ return utils$3.pattern.matchAny(filepath + '/', patternsRe);
6672
+ }
6673
+ return isMatched;
6674
+ }
6675
+ }
6621
6676
  entry$1.default = EntryFilter;
6622
6677
 
6623
6678
  var error = {};
6624
6679
 
6625
- Object.defineProperty(error, "__esModule", { value: true });
6626
- const utils$2 = utils$k;
6627
- class ErrorFilter {
6628
- constructor(_settings) {
6629
- this._settings = _settings;
6630
- }
6631
- getFilter() {
6632
- return (error) => this._isNonFatalError(error);
6633
- }
6634
- _isNonFatalError(error) {
6635
- return utils$2.errno.isEnoentCodeError(error) || this._settings.suppressErrors;
6636
- }
6637
- }
6680
+ Object.defineProperty(error, "__esModule", { value: true });
6681
+ const utils$2 = utils$k;
6682
+ class ErrorFilter {
6683
+ constructor(_settings) {
6684
+ this._settings = _settings;
6685
+ }
6686
+ getFilter() {
6687
+ return (error) => this._isNonFatalError(error);
6688
+ }
6689
+ _isNonFatalError(error) {
6690
+ return utils$2.errno.isEnoentCodeError(error) || this._settings.suppressErrors;
6691
+ }
6692
+ }
6638
6693
  error.default = ErrorFilter;
6639
6694
 
6640
6695
  var entry = {};
6641
6696
 
6642
- Object.defineProperty(entry, "__esModule", { value: true });
6643
- const utils$1 = utils$k;
6644
- class EntryTransformer {
6645
- constructor(_settings) {
6646
- this._settings = _settings;
6647
- }
6648
- getTransformer() {
6649
- return (entry) => this._transform(entry);
6650
- }
6651
- _transform(entry) {
6652
- let filepath = entry.path;
6653
- if (this._settings.absolute) {
6654
- filepath = utils$1.path.makeAbsolute(this._settings.cwd, filepath);
6655
- filepath = utils$1.path.unixify(filepath);
6656
- }
6657
- if (this._settings.markDirectories && entry.dirent.isDirectory()) {
6658
- filepath += '/';
6659
- }
6660
- if (!this._settings.objectMode) {
6661
- return filepath;
6662
- }
6663
- return Object.assign(Object.assign({}, entry), { path: filepath });
6664
- }
6665
- }
6697
+ Object.defineProperty(entry, "__esModule", { value: true });
6698
+ const utils$1 = utils$k;
6699
+ class EntryTransformer {
6700
+ constructor(_settings) {
6701
+ this._settings = _settings;
6702
+ }
6703
+ getTransformer() {
6704
+ return (entry) => this._transform(entry);
6705
+ }
6706
+ _transform(entry) {
6707
+ let filepath = entry.path;
6708
+ if (this._settings.absolute) {
6709
+ filepath = utils$1.path.makeAbsolute(this._settings.cwd, filepath);
6710
+ filepath = utils$1.path.unixify(filepath);
6711
+ }
6712
+ if (this._settings.markDirectories && entry.dirent.isDirectory()) {
6713
+ filepath += '/';
6714
+ }
6715
+ if (!this._settings.objectMode) {
6716
+ return filepath;
6717
+ }
6718
+ return Object.assign(Object.assign({}, entry), { path: filepath });
6719
+ }
6720
+ }
6666
6721
  entry.default = EntryTransformer;
6667
6722
 
6668
- Object.defineProperty(provider, "__esModule", { value: true });
6669
- const path = f$1;
6670
- const deep_1 = deep;
6671
- const entry_1 = entry$1;
6672
- const error_1 = error;
6673
- const entry_2 = entry;
6674
- class Provider {
6675
- constructor(_settings) {
6676
- this._settings = _settings;
6677
- this.errorFilter = new error_1.default(this._settings);
6678
- this.entryFilter = new entry_1.default(this._settings, this._getMicromatchOptions());
6679
- this.deepFilter = new deep_1.default(this._settings, this._getMicromatchOptions());
6680
- this.entryTransformer = new entry_2.default(this._settings);
6681
- }
6682
- _getRootDirectory(task) {
6683
- return path.resolve(this._settings.cwd, task.base);
6684
- }
6685
- _getReaderOptions(task) {
6686
- const basePath = task.base === '.' ? '' : task.base;
6687
- return {
6688
- basePath,
6689
- pathSegmentSeparator: '/',
6690
- concurrency: this._settings.concurrency,
6691
- deepFilter: this.deepFilter.getFilter(basePath, task.positive, task.negative),
6692
- entryFilter: this.entryFilter.getFilter(task.positive, task.negative),
6693
- errorFilter: this.errorFilter.getFilter(),
6694
- followSymbolicLinks: this._settings.followSymbolicLinks,
6695
- fs: this._settings.fs,
6696
- stats: this._settings.stats,
6697
- throwErrorOnBrokenSymbolicLink: this._settings.throwErrorOnBrokenSymbolicLink,
6698
- transform: this.entryTransformer.getTransformer()
6699
- };
6700
- }
6701
- _getMicromatchOptions() {
6702
- return {
6703
- dot: this._settings.dot,
6704
- matchBase: this._settings.baseNameMatch,
6705
- nobrace: !this._settings.braceExpansion,
6706
- nocase: !this._settings.caseSensitiveMatch,
6707
- noext: !this._settings.extglob,
6708
- noglobstar: !this._settings.globstar,
6709
- posix: true,
6710
- strictSlashes: false
6711
- };
6712
- }
6713
- }
6723
+ Object.defineProperty(provider, "__esModule", { value: true });
6724
+ const path = f$1;
6725
+ const deep_1 = deep;
6726
+ const entry_1 = entry$1;
6727
+ const error_1 = error;
6728
+ const entry_2 = entry;
6729
+ class Provider {
6730
+ constructor(_settings) {
6731
+ this._settings = _settings;
6732
+ this.errorFilter = new error_1.default(this._settings);
6733
+ this.entryFilter = new entry_1.default(this._settings, this._getMicromatchOptions());
6734
+ this.deepFilter = new deep_1.default(this._settings, this._getMicromatchOptions());
6735
+ this.entryTransformer = new entry_2.default(this._settings);
6736
+ }
6737
+ _getRootDirectory(task) {
6738
+ return path.resolve(this._settings.cwd, task.base);
6739
+ }
6740
+ _getReaderOptions(task) {
6741
+ const basePath = task.base === '.' ? '' : task.base;
6742
+ return {
6743
+ basePath,
6744
+ pathSegmentSeparator: '/',
6745
+ concurrency: this._settings.concurrency,
6746
+ deepFilter: this.deepFilter.getFilter(basePath, task.positive, task.negative),
6747
+ entryFilter: this.entryFilter.getFilter(task.positive, task.negative),
6748
+ errorFilter: this.errorFilter.getFilter(),
6749
+ followSymbolicLinks: this._settings.followSymbolicLinks,
6750
+ fs: this._settings.fs,
6751
+ stats: this._settings.stats,
6752
+ throwErrorOnBrokenSymbolicLink: this._settings.throwErrorOnBrokenSymbolicLink,
6753
+ transform: this.entryTransformer.getTransformer()
6754
+ };
6755
+ }
6756
+ _getMicromatchOptions() {
6757
+ return {
6758
+ dot: this._settings.dot,
6759
+ matchBase: this._settings.baseNameMatch,
6760
+ nobrace: !this._settings.braceExpansion,
6761
+ nocase: !this._settings.caseSensitiveMatch,
6762
+ noext: !this._settings.extglob,
6763
+ noglobstar: !this._settings.globstar,
6764
+ posix: true,
6765
+ strictSlashes: false
6766
+ };
6767
+ }
6768
+ }
6714
6769
  provider.default = Provider;
6715
6770
 
6716
- Object.defineProperty(async$7, "__esModule", { value: true });
6717
- const async_1$1 = async$6;
6718
- const provider_1$2 = provider;
6719
- class ProviderAsync extends provider_1$2.default {
6720
- constructor() {
6721
- super(...arguments);
6722
- this._reader = new async_1$1.default(this._settings);
6723
- }
6724
- async read(task) {
6725
- const root = this._getRootDirectory(task);
6726
- const options = this._getReaderOptions(task);
6727
- const entries = await this.api(root, task, options);
6728
- return entries.map((entry) => options.transform(entry));
6729
- }
6730
- api(root, task, options) {
6731
- if (task.dynamic) {
6732
- return this._reader.dynamic(root, options);
6733
- }
6734
- return this._reader.static(task.patterns, options);
6735
- }
6736
- }
6771
+ Object.defineProperty(async$7, "__esModule", { value: true });
6772
+ const async_1$1 = async$6;
6773
+ const provider_1$2 = provider;
6774
+ class ProviderAsync extends provider_1$2.default {
6775
+ constructor() {
6776
+ super(...arguments);
6777
+ this._reader = new async_1$1.default(this._settings);
6778
+ }
6779
+ async read(task) {
6780
+ const root = this._getRootDirectory(task);
6781
+ const options = this._getReaderOptions(task);
6782
+ const entries = await this.api(root, task, options);
6783
+ return entries.map((entry) => options.transform(entry));
6784
+ }
6785
+ api(root, task, options) {
6786
+ if (task.dynamic) {
6787
+ return this._reader.dynamic(root, options);
6788
+ }
6789
+ return this._reader.static(task.patterns, options);
6790
+ }
6791
+ }
6737
6792
  async$7.default = ProviderAsync;
6738
6793
 
6739
6794
  var stream = {};
6740
6795
 
6741
- Object.defineProperty(stream, "__esModule", { value: true });
6742
- const stream_1$1 = require$$0$1;
6743
- const stream_2 = stream$1;
6744
- const provider_1$1 = provider;
6745
- class ProviderStream extends provider_1$1.default {
6746
- constructor() {
6747
- super(...arguments);
6748
- this._reader = new stream_2.default(this._settings);
6749
- }
6750
- read(task) {
6751
- const root = this._getRootDirectory(task);
6752
- const options = this._getReaderOptions(task);
6753
- const source = this.api(root, task, options);
6754
- const destination = new stream_1$1.Readable({ objectMode: true, read: () => { } });
6755
- source
6756
- .once('error', (error) => destination.emit('error', error))
6757
- .on('data', (entry) => destination.emit('data', options.transform(entry)))
6758
- .once('end', () => destination.emit('end'));
6759
- destination
6760
- .once('close', () => source.destroy());
6761
- return destination;
6762
- }
6763
- api(root, task, options) {
6764
- if (task.dynamic) {
6765
- return this._reader.dynamic(root, options);
6766
- }
6767
- return this._reader.static(task.patterns, options);
6768
- }
6769
- }
6796
+ Object.defineProperty(stream, "__esModule", { value: true });
6797
+ const stream_1$1 = require$$0$1;
6798
+ const stream_2 = stream$1;
6799
+ const provider_1$1 = provider;
6800
+ class ProviderStream extends provider_1$1.default {
6801
+ constructor() {
6802
+ super(...arguments);
6803
+ this._reader = new stream_2.default(this._settings);
6804
+ }
6805
+ read(task) {
6806
+ const root = this._getRootDirectory(task);
6807
+ const options = this._getReaderOptions(task);
6808
+ const source = this.api(root, task, options);
6809
+ const destination = new stream_1$1.Readable({ objectMode: true, read: () => { } });
6810
+ source
6811
+ .once('error', (error) => destination.emit('error', error))
6812
+ .on('data', (entry) => destination.emit('data', options.transform(entry)))
6813
+ .once('end', () => destination.emit('end'));
6814
+ destination
6815
+ .once('close', () => source.destroy());
6816
+ return destination;
6817
+ }
6818
+ api(root, task, options) {
6819
+ if (task.dynamic) {
6820
+ return this._reader.dynamic(root, options);
6821
+ }
6822
+ return this._reader.static(task.patterns, options);
6823
+ }
6824
+ }
6770
6825
  stream.default = ProviderStream;
6771
6826
 
6772
6827
  var sync$1 = {};
6773
6828
 
6774
6829
  var sync = {};
6775
6830
 
6776
- Object.defineProperty(sync, "__esModule", { value: true });
6777
- const fsStat = out$1;
6778
- const fsWalk = out$3;
6779
- const reader_1 = reader;
6780
- class ReaderSync extends reader_1.default {
6781
- constructor() {
6782
- super(...arguments);
6783
- this._walkSync = fsWalk.walkSync;
6784
- this._statSync = fsStat.statSync;
6785
- }
6786
- dynamic(root, options) {
6787
- return this._walkSync(root, options);
6788
- }
6789
- static(patterns, options) {
6790
- const entries = [];
6791
- for (const pattern of patterns) {
6792
- const filepath = this._getFullEntryPath(pattern);
6793
- const entry = this._getEntry(filepath, pattern, options);
6794
- if (entry === null || !options.entryFilter(entry)) {
6795
- continue;
6796
- }
6797
- entries.push(entry);
6798
- }
6799
- return entries;
6800
- }
6801
- _getEntry(filepath, pattern, options) {
6802
- try {
6803
- const stats = this._getStat(filepath);
6804
- return this._makeEntry(stats, pattern);
6805
- }
6806
- catch (error) {
6807
- if (options.errorFilter(error)) {
6808
- return null;
6809
- }
6810
- throw error;
6811
- }
6812
- }
6813
- _getStat(filepath) {
6814
- return this._statSync(filepath, this._fsStatSettings);
6815
- }
6816
- }
6831
+ Object.defineProperty(sync, "__esModule", { value: true });
6832
+ const fsStat = out$1;
6833
+ const fsWalk = out$3;
6834
+ const reader_1 = reader;
6835
+ class ReaderSync extends reader_1.default {
6836
+ constructor() {
6837
+ super(...arguments);
6838
+ this._walkSync = fsWalk.walkSync;
6839
+ this._statSync = fsStat.statSync;
6840
+ }
6841
+ dynamic(root, options) {
6842
+ return this._walkSync(root, options);
6843
+ }
6844
+ static(patterns, options) {
6845
+ const entries = [];
6846
+ for (const pattern of patterns) {
6847
+ const filepath = this._getFullEntryPath(pattern);
6848
+ const entry = this._getEntry(filepath, pattern, options);
6849
+ if (entry === null || !options.entryFilter(entry)) {
6850
+ continue;
6851
+ }
6852
+ entries.push(entry);
6853
+ }
6854
+ return entries;
6855
+ }
6856
+ _getEntry(filepath, pattern, options) {
6857
+ try {
6858
+ const stats = this._getStat(filepath);
6859
+ return this._makeEntry(stats, pattern);
6860
+ }
6861
+ catch (error) {
6862
+ if (options.errorFilter(error)) {
6863
+ return null;
6864
+ }
6865
+ throw error;
6866
+ }
6867
+ }
6868
+ _getStat(filepath) {
6869
+ return this._statSync(filepath, this._fsStatSettings);
6870
+ }
6871
+ }
6817
6872
  sync.default = ReaderSync;
6818
6873
 
6819
- Object.defineProperty(sync$1, "__esModule", { value: true });
6820
- const sync_1$1 = sync;
6821
- const provider_1 = provider;
6822
- class ProviderSync extends provider_1.default {
6823
- constructor() {
6824
- super(...arguments);
6825
- this._reader = new sync_1$1.default(this._settings);
6826
- }
6827
- read(task) {
6828
- const root = this._getRootDirectory(task);
6829
- const options = this._getReaderOptions(task);
6830
- const entries = this.api(root, task, options);
6831
- return entries.map(options.transform);
6832
- }
6833
- api(root, task, options) {
6834
- if (task.dynamic) {
6835
- return this._reader.dynamic(root, options);
6836
- }
6837
- return this._reader.static(task.patterns, options);
6838
- }
6839
- }
6874
+ Object.defineProperty(sync$1, "__esModule", { value: true });
6875
+ const sync_1$1 = sync;
6876
+ const provider_1 = provider;
6877
+ class ProviderSync extends provider_1.default {
6878
+ constructor() {
6879
+ super(...arguments);
6880
+ this._reader = new sync_1$1.default(this._settings);
6881
+ }
6882
+ read(task) {
6883
+ const root = this._getRootDirectory(task);
6884
+ const options = this._getReaderOptions(task);
6885
+ const entries = this.api(root, task, options);
6886
+ return entries.map(options.transform);
6887
+ }
6888
+ api(root, task, options) {
6889
+ if (task.dynamic) {
6890
+ return this._reader.dynamic(root, options);
6891
+ }
6892
+ return this._reader.static(task.patterns, options);
6893
+ }
6894
+ }
6840
6895
  sync$1.default = ProviderSync;
6841
6896
 
6842
6897
  var settings = {};
6843
6898
 
6844
6899
  (function (exports) {
6845
- Object.defineProperty(exports, "__esModule", { value: true });
6846
- exports.DEFAULT_FILE_SYSTEM_ADAPTER = void 0;
6847
- const fs = $;
6848
- const os = require$$0;
6849
- /**
6850
- * The `os.cpus` method can return zero. We expect the number of cores to be greater than zero.
6851
- * https://github.com/nodejs/node/blob/7faeddf23a98c53896f8b574a6e66589e8fb1eb8/lib/os.js#L106-L107
6852
- */
6853
- const CPU_COUNT = Math.max(os.cpus().length, 1);
6854
- exports.DEFAULT_FILE_SYSTEM_ADAPTER = {
6855
- lstat: fs.lstat,
6856
- lstatSync: fs.lstatSync,
6857
- stat: fs.stat,
6858
- statSync: fs.statSync,
6859
- readdir: fs.readdir,
6860
- readdirSync: fs.readdirSync
6861
- };
6862
- class Settings {
6863
- constructor(_options = {}) {
6864
- this._options = _options;
6865
- this.absolute = this._getValue(this._options.absolute, false);
6866
- this.baseNameMatch = this._getValue(this._options.baseNameMatch, false);
6867
- this.braceExpansion = this._getValue(this._options.braceExpansion, true);
6868
- this.caseSensitiveMatch = this._getValue(this._options.caseSensitiveMatch, true);
6869
- this.concurrency = this._getValue(this._options.concurrency, CPU_COUNT);
6870
- this.cwd = this._getValue(this._options.cwd, process.cwd());
6871
- this.deep = this._getValue(this._options.deep, Infinity);
6872
- this.dot = this._getValue(this._options.dot, false);
6873
- this.extglob = this._getValue(this._options.extglob, true);
6874
- this.followSymbolicLinks = this._getValue(this._options.followSymbolicLinks, true);
6875
- this.fs = this._getFileSystemMethods(this._options.fs);
6876
- this.globstar = this._getValue(this._options.globstar, true);
6877
- this.ignore = this._getValue(this._options.ignore, []);
6878
- this.markDirectories = this._getValue(this._options.markDirectories, false);
6879
- this.objectMode = this._getValue(this._options.objectMode, false);
6880
- this.onlyDirectories = this._getValue(this._options.onlyDirectories, false);
6881
- this.onlyFiles = this._getValue(this._options.onlyFiles, true);
6882
- this.stats = this._getValue(this._options.stats, false);
6883
- this.suppressErrors = this._getValue(this._options.suppressErrors, false);
6884
- this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, false);
6885
- this.unique = this._getValue(this._options.unique, true);
6886
- if (this.onlyDirectories) {
6887
- this.onlyFiles = false;
6888
- }
6889
- if (this.stats) {
6890
- this.objectMode = true;
6891
- }
6892
- }
6893
- _getValue(option, value) {
6894
- return option === undefined ? value : option;
6895
- }
6896
- _getFileSystemMethods(methods = {}) {
6897
- return Object.assign(Object.assign({}, exports.DEFAULT_FILE_SYSTEM_ADAPTER), methods);
6898
- }
6899
- }
6900
+ Object.defineProperty(exports, "__esModule", { value: true });
6901
+ exports.DEFAULT_FILE_SYSTEM_ADAPTER = void 0;
6902
+ const fs = $;
6903
+ const os = require$$0;
6904
+ /**
6905
+ * The `os.cpus` method can return zero. We expect the number of cores to be greater than zero.
6906
+ * https://github.com/nodejs/node/blob/7faeddf23a98c53896f8b574a6e66589e8fb1eb8/lib/os.js#L106-L107
6907
+ */
6908
+ const CPU_COUNT = Math.max(os.cpus().length, 1);
6909
+ exports.DEFAULT_FILE_SYSTEM_ADAPTER = {
6910
+ lstat: fs.lstat,
6911
+ lstatSync: fs.lstatSync,
6912
+ stat: fs.stat,
6913
+ statSync: fs.statSync,
6914
+ readdir: fs.readdir,
6915
+ readdirSync: fs.readdirSync
6916
+ };
6917
+ class Settings {
6918
+ constructor(_options = {}) {
6919
+ this._options = _options;
6920
+ this.absolute = this._getValue(this._options.absolute, false);
6921
+ this.baseNameMatch = this._getValue(this._options.baseNameMatch, false);
6922
+ this.braceExpansion = this._getValue(this._options.braceExpansion, true);
6923
+ this.caseSensitiveMatch = this._getValue(this._options.caseSensitiveMatch, true);
6924
+ this.concurrency = this._getValue(this._options.concurrency, CPU_COUNT);
6925
+ this.cwd = this._getValue(this._options.cwd, process.cwd());
6926
+ this.deep = this._getValue(this._options.deep, Infinity);
6927
+ this.dot = this._getValue(this._options.dot, false);
6928
+ this.extglob = this._getValue(this._options.extglob, true);
6929
+ this.followSymbolicLinks = this._getValue(this._options.followSymbolicLinks, true);
6930
+ this.fs = this._getFileSystemMethods(this._options.fs);
6931
+ this.globstar = this._getValue(this._options.globstar, true);
6932
+ this.ignore = this._getValue(this._options.ignore, []);
6933
+ this.markDirectories = this._getValue(this._options.markDirectories, false);
6934
+ this.objectMode = this._getValue(this._options.objectMode, false);
6935
+ this.onlyDirectories = this._getValue(this._options.onlyDirectories, false);
6936
+ this.onlyFiles = this._getValue(this._options.onlyFiles, true);
6937
+ this.stats = this._getValue(this._options.stats, false);
6938
+ this.suppressErrors = this._getValue(this._options.suppressErrors, false);
6939
+ this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, false);
6940
+ this.unique = this._getValue(this._options.unique, true);
6941
+ if (this.onlyDirectories) {
6942
+ this.onlyFiles = false;
6943
+ }
6944
+ if (this.stats) {
6945
+ this.objectMode = true;
6946
+ }
6947
+ }
6948
+ _getValue(option, value) {
6949
+ return option === undefined ? value : option;
6950
+ }
6951
+ _getFileSystemMethods(methods = {}) {
6952
+ return Object.assign(Object.assign({}, exports.DEFAULT_FILE_SYSTEM_ADAPTER), methods);
6953
+ }
6954
+ }
6900
6955
  exports.default = Settings;
6901
6956
  } (settings));
6902
6957
 
6903
- const taskManager = tasks;
6904
- const patternManager = patterns;
6905
- const async_1 = async$7;
6906
- const stream_1 = stream;
6907
- const sync_1 = sync$1;
6908
- const settings_1 = settings;
6909
- const utils = utils$k;
6910
- async function FastGlob(source, options) {
6911
- assertPatternsInput(source);
6912
- const works = getWorks(source, async_1.default, options);
6913
- const result = await Promise.all(works);
6914
- return utils.array.flatten(result);
6915
- }
6916
- // https://github.com/typescript-eslint/typescript-eslint/issues/60
6917
- // eslint-disable-next-line no-redeclare
6918
- (function (FastGlob) {
6919
- function sync(source, options) {
6920
- assertPatternsInput(source);
6921
- const works = getWorks(source, sync_1.default, options);
6922
- return utils.array.flatten(works);
6923
- }
6924
- FastGlob.sync = sync;
6925
- function stream(source, options) {
6926
- assertPatternsInput(source);
6927
- const works = getWorks(source, stream_1.default, options);
6928
- /**
6929
- * The stream returned by the provider cannot work with an asynchronous iterator.
6930
- * To support asynchronous iterators, regardless of the number of tasks, we always multiplex streams.
6931
- * This affects performance (+25%). I don't see best solution right now.
6932
- */
6933
- return utils.stream.merge(works);
6934
- }
6935
- FastGlob.stream = stream;
6936
- function generateTasks(source, options) {
6937
- assertPatternsInput(source);
6938
- const patterns = patternManager.transform([].concat(source));
6939
- const settings = new settings_1.default(options);
6940
- return taskManager.generate(patterns, settings);
6941
- }
6942
- FastGlob.generateTasks = generateTasks;
6943
- function isDynamicPattern(source, options) {
6944
- assertPatternsInput(source);
6945
- const settings = new settings_1.default(options);
6946
- return utils.pattern.isDynamicPattern(source, settings);
6947
- }
6948
- FastGlob.isDynamicPattern = isDynamicPattern;
6949
- function escapePath(source) {
6950
- assertPatternsInput(source);
6951
- return utils.path.escape(source);
6952
- }
6953
- FastGlob.escapePath = escapePath;
6954
- })(FastGlob || (FastGlob = {}));
6955
- function getWorks(source, _Provider, options) {
6956
- const patterns = patternManager.transform([].concat(source));
6957
- const settings = new settings_1.default(options);
6958
- const tasks = taskManager.generate(patterns, settings);
6959
- const provider = new _Provider(settings);
6960
- return tasks.map(provider.read, provider);
6961
- }
6962
- function assertPatternsInput(input) {
6963
- const source = [].concat(input);
6964
- const isValidSource = source.every((item) => utils.string.isString(item) && !utils.string.isEmpty(item));
6965
- if (!isValidSource) {
6966
- throw new TypeError('Patterns must be a string (non empty) or an array of strings');
6967
- }
6968
- }
6958
+ const taskManager = tasks;
6959
+ const async_1 = async$7;
6960
+ const stream_1 = stream;
6961
+ const sync_1 = sync$1;
6962
+ const settings_1 = settings;
6963
+ const utils = utils$k;
6964
+ async function FastGlob(source, options) {
6965
+ assertPatternsInput(source);
6966
+ const works = getWorks(source, async_1.default, options);
6967
+ const result = await Promise.all(works);
6968
+ return utils.array.flatten(result);
6969
+ }
6970
+ // https://github.com/typescript-eslint/typescript-eslint/issues/60
6971
+ // eslint-disable-next-line no-redeclare
6972
+ (function (FastGlob) {
6973
+ FastGlob.glob = FastGlob;
6974
+ FastGlob.globSync = sync;
6975
+ FastGlob.globStream = stream;
6976
+ FastGlob.async = FastGlob;
6977
+ function sync(source, options) {
6978
+ assertPatternsInput(source);
6979
+ const works = getWorks(source, sync_1.default, options);
6980
+ return utils.array.flatten(works);
6981
+ }
6982
+ FastGlob.sync = sync;
6983
+ function stream(source, options) {
6984
+ assertPatternsInput(source);
6985
+ const works = getWorks(source, stream_1.default, options);
6986
+ /**
6987
+ * The stream returned by the provider cannot work with an asynchronous iterator.
6988
+ * To support asynchronous iterators, regardless of the number of tasks, we always multiplex streams.
6989
+ * This affects performance (+25%). I don't see best solution right now.
6990
+ */
6991
+ return utils.stream.merge(works);
6992
+ }
6993
+ FastGlob.stream = stream;
6994
+ function generateTasks(source, options) {
6995
+ assertPatternsInput(source);
6996
+ const patterns = [].concat(source);
6997
+ const settings = new settings_1.default(options);
6998
+ return taskManager.generate(patterns, settings);
6999
+ }
7000
+ FastGlob.generateTasks = generateTasks;
7001
+ function isDynamicPattern(source, options) {
7002
+ assertPatternsInput(source);
7003
+ const settings = new settings_1.default(options);
7004
+ return utils.pattern.isDynamicPattern(source, settings);
7005
+ }
7006
+ FastGlob.isDynamicPattern = isDynamicPattern;
7007
+ function escapePath(source) {
7008
+ assertPatternsInput(source);
7009
+ return utils.path.escape(source);
7010
+ }
7011
+ FastGlob.escapePath = escapePath;
7012
+ function convertPathToPattern(source) {
7013
+ assertPatternsInput(source);
7014
+ return utils.path.convertPathToPattern(source);
7015
+ }
7016
+ FastGlob.convertPathToPattern = convertPathToPattern;
7017
+ (function (posix) {
7018
+ function escapePath(source) {
7019
+ assertPatternsInput(source);
7020
+ return utils.path.escapePosixPath(source);
7021
+ }
7022
+ posix.escapePath = escapePath;
7023
+ function convertPathToPattern(source) {
7024
+ assertPatternsInput(source);
7025
+ return utils.path.convertPosixPathToPattern(source);
7026
+ }
7027
+ posix.convertPathToPattern = convertPathToPattern;
7028
+ })(FastGlob.posix || (FastGlob.posix = {}));
7029
+ (function (win32) {
7030
+ function escapePath(source) {
7031
+ assertPatternsInput(source);
7032
+ return utils.path.escapeWindowsPath(source);
7033
+ }
7034
+ win32.escapePath = escapePath;
7035
+ function convertPathToPattern(source) {
7036
+ assertPatternsInput(source);
7037
+ return utils.path.convertWindowsPathToPattern(source);
7038
+ }
7039
+ win32.convertPathToPattern = convertPathToPattern;
7040
+ })(FastGlob.win32 || (FastGlob.win32 = {}));
7041
+ })(FastGlob || (FastGlob = {}));
7042
+ function getWorks(source, _Provider, options) {
7043
+ const patterns = [].concat(source);
7044
+ const settings = new settings_1.default(options);
7045
+ const tasks = taskManager.generate(patterns, settings);
7046
+ const provider = new _Provider(settings);
7047
+ return tasks.map(provider.read, provider);
7048
+ }
7049
+ function assertPatternsInput(input) {
7050
+ const source = [].concat(input);
7051
+ const isValidSource = source.every((item) => utils.string.isString(item) && !utils.string.isEmpty(item));
7052
+ if (!isValidSource) {
7053
+ throw new TypeError('Patterns must be a string (non empty) or an array of strings');
7054
+ }
7055
+ }
6969
7056
  var out = FastGlob;
6970
7057
 
6971
7058
  var fg = /*@__PURE__*/getDefaultExportFromCjs(out);
@@ -10167,7 +10254,7 @@ class StateManager {
10167
10254
  }
10168
10255
  }
10169
10256
 
10170
- const defaultInclude = ["**/__tests__/**/*.?(c|m)[jt]s?(x)", "**/?(*.){test,spec}.?(c|m)[jt]s?(x)"];
10257
+ const defaultInclude = ["**/*.{test,spec}.?(c|m)[jt]s?(x)"];
10171
10258
  const defaultExclude = ["**/node_modules/**", "**/dist/**", "**/cypress/**", "**/.{idea,git,cache,output,temp}/**", "**/{karma,rollup,webpack,vite,vitest,jest,ava,babel,nyc,cypress,tsup,build}.config.*"];
10172
10259
  const benchmarkConfigDefaults = {
10173
10260
  include: ["**/*.{bench,benchmark}.?(c|m)[jt]s?(x)"],
@@ -10251,7 +10338,7 @@ const config = {
10251
10338
  dangerouslyIgnoreUnhandledErrors: false,
10252
10339
  typecheck: {
10253
10340
  checker: "tsc",
10254
- include: ["**/?(*.){test,spec}-d.?(c|m)[jt]s?(x)"],
10341
+ include: ["**/*.{test,spec}-d.?(c|m)[jt]s?(x)"],
10255
10342
  exclude: defaultExclude
10256
10343
  },
10257
10344
  slowTestThreshold: 300
@@ -11189,7 +11276,7 @@ createLogUpdate(process$1.stdout);
11189
11276
 
11190
11277
  createLogUpdate(process$1.stderr);
11191
11278
 
11192
- var version = "0.32.3";
11279
+ var version = "0.33.0";
11193
11280
 
11194
11281
  const comma = ','.charCodeAt(0);
11195
11282
  const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';