snyk 1.1024.0 → 1.1025.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.
@@ -5617,6 +5617,7 @@ async function analyzeFolders(options) {
5617
5617
  ...options.connection,
5618
5618
  ...options.fileOptions,
5619
5619
  languages: options.languages,
5620
+ ...(options.analysisContext ? { analysisContext: options.analysisContext } : {}),
5620
5621
  });
5621
5622
  if (fileBundle === null)
5622
5623
  return null;
@@ -5796,7 +5797,7 @@ async function* prepareRemoteBundle(options) {
5796
5797
  emitter_1.emitter.createBundleProgress(cumulativeProgress, options.files.length);
5797
5798
  for (const chunkedFiles of (0, files_1.composeFilePayloads)(options.files, constants_1.MAX_PAYLOAD)) {
5798
5799
  const apiParams = {
5799
- ...(0, lodash_pick_1.default)(options, ['baseURL', 'sessionToken', 'source', 'removedFiles', 'requestId', 'base64Encoding']),
5800
+ ...(0, lodash_pick_1.default)(options, ['baseURL', 'sessionToken', 'source', 'removedFiles', 'requestId', 'base64Encoding', 'org']),
5800
5801
  files: chunkedFiles.reduce((d, f) => {
5801
5802
  // deepcode ignore PrototypePollution: FP this is an internal code
5802
5803
  d[f.bundlePath] = f.hash;
@@ -5831,7 +5832,15 @@ async function* prepareRemoteBundle(options) {
5831
5832
  async function uploadRemoteBundle(options) {
5832
5833
  let uploadedFiles = 0;
5833
5834
  emitter_1.emitter.uploadBundleProgress(0, options.files.length);
5834
- const apiParams = (0, lodash_pick_1.default)(options, ['baseURL', 'sessionToken', 'source', 'bundleHash', 'requestId', 'base64Encoding']);
5835
+ const apiParams = (0, lodash_pick_1.default)(options, [
5836
+ 'baseURL',
5837
+ 'sessionToken',
5838
+ 'source',
5839
+ 'bundleHash',
5840
+ 'requestId',
5841
+ 'base64Encoding',
5842
+ 'org',
5843
+ ]);
5835
5844
  const uploadFileChunks = async (bucketFiles) => {
5836
5845
  // Note: we specifically create __new__ isolated bundles here to faster files upload
5837
5846
  const resp = await (0, http_1.createBundle)({
@@ -5860,7 +5869,7 @@ async function fullfillRemoteBundle(options) {
5860
5869
  // Check remove bundle to make sure no missing files left
5861
5870
  let attempts = 0;
5862
5871
  let { remoteBundle } = options;
5863
- const connectionOptions = (0, lodash_pick_1.default)(options, ['baseURL', 'sessionToken', 'source', 'requestId', 'base64Encoding']);
5872
+ const connectionOptions = (0, lodash_pick_1.default)(options, ['baseURL', 'sessionToken', 'source', 'requestId', 'base64Encoding', 'org']);
5864
5873
  while (remoteBundle.missingFiles.length && attempts < (options.maxAttempts || constants_1.MAX_UPLOAD_ATTEMPTS)) {
5865
5874
  const missingFiles = await (0, files_1.resolveBundleFiles)(options.baseDir, remoteBundle.missingFiles);
5866
5875
  await uploadRemoteBundle({
@@ -5880,7 +5889,15 @@ async function fullfillRemoteBundle(options) {
5880
5889
  }
5881
5890
  async function remoteBundleFactory(options) {
5882
5891
  let remoteBundle = null;
5883
- const baseOptions = (0, lodash_pick_1.default)(options, ['baseURL', 'sessionToken', 'source', 'baseDir', 'requestId', 'base64Encoding']);
5892
+ const baseOptions = (0, lodash_pick_1.default)(options, [
5893
+ 'baseURL',
5894
+ 'sessionToken',
5895
+ 'source',
5896
+ 'baseDir',
5897
+ 'requestId',
5898
+ 'base64Encoding',
5899
+ 'org',
5900
+ ]);
5884
5901
  const bundleFactory = prepareRemoteBundle((0, lodash_omit_1.default)(options, ['baseDir']));
5885
5902
  for await (const response of bundleFactory) {
5886
5903
  if (response.type === 'error') {
@@ -5928,6 +5945,7 @@ async function getSupportedFiles(baseURL, source, requestId, languages) {
5928
5945
  * @returns {Promise<FileBundle | null>}
5929
5946
  */
5930
5947
  async function createBundleFromFolders(options) {
5948
+ var _a, _b;
5931
5949
  const baseDir = (0, files_1.determineBaseDir)(options.paths);
5932
5950
  const [supportedFiles, fileIgnores] = await Promise.all([
5933
5951
  // Fetch supporte files to save network traffic
@@ -5954,6 +5972,7 @@ async function createBundleFromFolders(options) {
5954
5972
  ...(0, lodash_pick_1.default)(options, ['baseURL', 'sessionToken', 'source', 'requestId', 'base64Encoding']),
5955
5973
  baseDir,
5956
5974
  files: bundleFiles,
5975
+ ...(((_b = (_a = options.analysisContext) === null || _a === void 0 ? void 0 : _a.org) === null || _b === void 0 ? void 0 : _b.name) ? { org: options.analysisContext.org.name } : {}),
5957
5976
  };
5958
5977
  // Create remote bundle
5959
5978
  if (!bundleFiles.length)
@@ -6208,7 +6227,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
6208
6227
  exports.isMatch = exports.composeFilePayloads = exports.resolveBundleFilePath = exports.resolveBundleFiles = exports.getFileInfo = exports.calcHash = exports.getBundleFilePath = exports.prepareExtendingBundle = exports.collectBundleFiles = exports.determineBaseDir = exports.collectIgnoreRules = exports.getGlobPatterns = exports.parseFileIgnores = exports.notEmpty = void 0;
6209
6228
  const nodePath = __importStar(__webpack_require__(85622));
6210
6229
  const fs = __importStar(__webpack_require__(35747));
6211
- const fast_glob_1 = __importDefault(__webpack_require__(8381));
6230
+ const fast_glob_1 = __importDefault(__webpack_require__(13294));
6212
6231
  const multimatch_1 = __importDefault(__webpack_require__(23424));
6213
6232
  const crypto_1 = __importDefault(__webpack_require__(76417));
6214
6233
  const yaml_1 = __webpack_require__(6792);
@@ -6765,6 +6784,7 @@ async function createBundle(options) {
6765
6784
  source: options.source,
6766
6785
  ...(options.requestId && { 'snyk-request-id': options.requestId }),
6767
6786
  ...(base64Encoding ? { 'content-type': 'application/octet-stream', 'content-encoding': 'gzip' } : null),
6787
+ ...(options.org && { 'snyk-org-name': options.org }),
6768
6788
  },
6769
6789
  url: `${options.baseURL}/bundle`,
6770
6790
  method: 'post',
@@ -6790,6 +6810,7 @@ async function checkBundle(options) {
6790
6810
  ...prepareTokenHeaders(options.sessionToken),
6791
6811
  source: options.source,
6792
6812
  ...(options.requestId && { 'snyk-request-id': options.requestId }),
6813
+ ...(options.org && { 'snyk-org-name': options.org }),
6793
6814
  },
6794
6815
  url: `${options.baseURL}/bundle/${options.bundleHash}`,
6795
6816
  method: 'get',
@@ -6822,6 +6843,7 @@ async function extendBundle(options) {
6822
6843
  source: options.source,
6823
6844
  ...(options.requestId && { 'snyk-request-id': options.requestId }),
6824
6845
  ...(base64Encoding ? { 'content-type': 'application/octet-stream', 'content-encoding': 'gzip' } : null),
6846
+ ...(options.org && { 'snyk-org-name': options.org }),
6825
6847
  },
6826
6848
  url: `${options.baseURL}/bundle/${options.bundleHash}`,
6827
6849
  method: 'put',
@@ -6857,6 +6879,7 @@ async function getAnalysis(options) {
6857
6879
  ...prepareTokenHeaders(options.sessionToken),
6858
6880
  source: options.source,
6859
6881
  ...(options.requestId && { 'snyk-request-id': options.requestId }),
6882
+ ...(options.org && { 'snyk-org-name': options.org }),
6860
6883
  },
6861
6884
  url: `${options.baseURL}/analysis`,
6862
6885
  method: 'post',
@@ -14808,1242 +14831,95 @@ Object.defineProperty(exports, "__esModule", ({ value: true }));
14808
14831
 
14809
14832
  /***/ }),
14810
14833
 
14811
- /***/ 8381:
14834
+ /***/ 10635:
14812
14835
  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
14813
14836
 
14814
14837
  "use strict";
14815
14838
 
14816
- const taskManager = __webpack_require__(32972);
14817
- const async_1 = __webpack_require__(64002);
14818
- const stream_1 = __webpack_require__(3480);
14819
- const sync_1 = __webpack_require__(62512);
14820
- const settings_1 = __webpack_require__(95879);
14821
- const utils = __webpack_require__(73290);
14822
- async function FastGlob(source, options) {
14823
- assertPatternsInput(source);
14824
- const works = getWorks(source, async_1.default, options);
14825
- const result = await Promise.all(works);
14826
- return utils.array.flatten(result);
14827
- }
14828
- // https://github.com/typescript-eslint/typescript-eslint/issues/60
14829
- // eslint-disable-next-line no-redeclare
14830
- (function (FastGlob) {
14831
- function sync(source, options) {
14832
- assertPatternsInput(source);
14833
- const works = getWorks(source, sync_1.default, options);
14834
- return utils.array.flatten(works);
14835
- }
14836
- FastGlob.sync = sync;
14837
- function stream(source, options) {
14838
- assertPatternsInput(source);
14839
- const works = getWorks(source, stream_1.default, options);
14840
- /**
14841
- * The stream returned by the provider cannot work with an asynchronous iterator.
14842
- * To support asynchronous iterators, regardless of the number of tasks, we always multiplex streams.
14843
- * This affects performance (+25%). I don't see best solution right now.
14844
- */
14845
- return utils.stream.merge(works);
14846
- }
14847
- FastGlob.stream = stream;
14848
- function generateTasks(source, options) {
14849
- assertPatternsInput(source);
14850
- const patterns = [].concat(source);
14851
- const settings = new settings_1.default(options);
14852
- return taskManager.generate(patterns, settings);
14853
- }
14854
- FastGlob.generateTasks = generateTasks;
14855
- function isDynamicPattern(source, options) {
14856
- assertPatternsInput(source);
14857
- const settings = new settings_1.default(options);
14858
- return utils.pattern.isDynamicPattern(source, settings);
14859
- }
14860
- FastGlob.isDynamicPattern = isDynamicPattern;
14861
- function escapePath(source) {
14862
- assertPatternsInput(source);
14863
- return utils.path.escape(source);
14864
- }
14865
- FastGlob.escapePath = escapePath;
14866
- })(FastGlob || (FastGlob = {}));
14867
- function getWorks(source, _Provider, options) {
14868
- const patterns = [].concat(source);
14869
- const settings = new settings_1.default(options);
14870
- const tasks = taskManager.generate(patterns, settings);
14871
- const provider = new _Provider(settings);
14872
- return tasks.map(provider.read, provider);
14873
- }
14874
- function assertPatternsInput(input) {
14875
- const source = [].concat(input);
14876
- const isValidSource = source.every((item) => utils.string.isString(item) && !utils.string.isEmpty(item));
14877
- if (!isValidSource) {
14878
- throw new TypeError('Patterns must be a string (non empty) or an array of strings');
14879
- }
14880
- }
14881
- module.exports = FastGlob;
14882
14839
 
14840
+ const fs = __webpack_require__(35747);
14841
+ const path = __webpack_require__(85622);
14842
+ const assert = __webpack_require__(42357);
14883
14843
 
14884
- /***/ }),
14844
+ const GEMFILE_DEFAULT_LOCATION = path.resolve(process.cwd(), 'Gemfile.lock');
14845
+ const WHITESPACE = /^(\s*)/;
14846
+ const GEMFILE_KEY_VALUE = /^\s*([^:(]*)\s*\:*\s*(.*)/;
14847
+ const ORIGINS = ['GEM', 'GIT', 'PATH'];
14848
+ const RUBY = /^ruby\s(.*)/;
14885
14849
 
14886
- /***/ 32972:
14887
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
14850
+ module.exports = {
14851
+ interpret,
14852
+ parse,
14853
+ parseSync
14854
+ };
14888
14855
 
14889
- "use strict";
14856
+ function interpret(string, extractMeta) {
14857
+ assert(
14858
+ typeof string === 'string',
14859
+ 'gemfile.interpret expects a UTF-8 Gemfile.lock string source.'
14860
+ );
14890
14861
 
14891
- Object.defineProperty(exports, "__esModule", ({ value: true }));
14892
- exports.convertPatternGroupToTask = exports.convertPatternGroupsToTasks = exports.groupPatternsByBaseDirectory = exports.getNegativePatternsAsPositive = exports.getPositivePatterns = exports.convertPatternsToTasks = exports.generate = void 0;
14893
- const utils = __webpack_require__(73290);
14894
- function generate(patterns, settings) {
14895
- const positivePatterns = getPositivePatterns(patterns);
14896
- const negativePatterns = getNegativePatternsAsPositive(patterns, settings.ignore);
14897
- const staticPatterns = positivePatterns.filter((pattern) => utils.pattern.isStaticPattern(pattern, settings));
14898
- const dynamicPatterns = positivePatterns.filter((pattern) => utils.pattern.isDynamicPattern(pattern, settings));
14899
- const staticTasks = convertPatternsToTasks(staticPatterns, negativePatterns, /* dynamic */ false);
14900
- const dynamicTasks = convertPatternsToTasks(dynamicPatterns, negativePatterns, /* dynamic */ true);
14901
- return staticTasks.concat(dynamicTasks);
14902
- }
14903
- exports.generate = generate;
14904
- function convertPatternsToTasks(positive, negative, dynamic) {
14905
- const positivePatternsGroup = groupPatternsByBaseDirectory(positive);
14906
- // When we have a global group – there is no reason to divide the patterns into independent tasks.
14907
- // In this case, the global task covers the rest.
14908
- if ('.' in positivePatternsGroup) {
14909
- const task = convertPatternGroupToTask('.', positive, negative, dynamic);
14910
- return [task];
14911
- }
14912
- return convertPatternGroupsToTasks(positivePatternsGroup, negative, dynamic);
14913
- }
14914
- exports.convertPatternsToTasks = convertPatternsToTasks;
14915
- function getPositivePatterns(patterns) {
14916
- return utils.pattern.getPositivePatterns(patterns);
14917
- }
14918
- exports.getPositivePatterns = getPositivePatterns;
14919
- function getNegativePatternsAsPositive(patterns, ignore) {
14920
- const negative = utils.pattern.getNegativePatterns(patterns).concat(ignore);
14921
- const positive = negative.map(utils.pattern.convertToPositivePattern);
14922
- return positive;
14923
- }
14924
- exports.getNegativePatternsAsPositive = getNegativePatternsAsPositive;
14925
- function groupPatternsByBaseDirectory(patterns) {
14926
- const group = {};
14927
- return patterns.reduce((collection, pattern) => {
14928
- const base = utils.pattern.getBaseDirectory(pattern);
14929
- if (base in collection) {
14930
- collection[base].push(pattern);
14931
- }
14932
- else {
14933
- collection[base] = [pattern];
14934
- }
14935
- return collection;
14936
- }, group);
14937
- }
14938
- exports.groupPatternsByBaseDirectory = groupPatternsByBaseDirectory;
14939
- function convertPatternGroupsToTasks(positive, negative, dynamic) {
14940
- return Object.keys(positive).map((base) => {
14941
- return convertPatternGroupToTask(base, positive[base], negative, dynamic);
14942
- });
14943
- }
14944
- exports.convertPatternGroupsToTasks = convertPatternGroupsToTasks;
14945
- function convertPatternGroupToTask(base, positive, negative, dynamic) {
14946
- return {
14947
- dynamic,
14948
- positive,
14949
- negative,
14950
- base,
14951
- patterns: [].concat(positive, negative.map(utils.pattern.convertToNegativePattern))
14952
- };
14953
- }
14954
- exports.convertPatternGroupToTask = convertPatternGroupToTask;
14862
+ const gemfileMeta = {};
14955
14863
 
14864
+ let line;
14865
+ let index = 0;
14866
+ let previousWhitespace = -1;
14867
+ let keyCount = {};
14868
+ let gemfile = {};
14869
+ let lines = string.split('\n');
14870
+ let stack = [];
14956
14871
 
14957
- /***/ }),
14872
+ while((line = lines[index++]) !== undefined) {
14958
14873
 
14959
- /***/ 64002:
14960
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
14874
+ // Handle depth stack changes
14961
14875
 
14962
- "use strict";
14876
+ let whitespace = WHITESPACE.exec(line)[1].length;
14963
14877
 
14964
- Object.defineProperty(exports, "__esModule", ({ value: true }));
14965
- const stream_1 = __webpack_require__(3986);
14966
- const provider_1 = __webpack_require__(29834);
14967
- class ProviderAsync extends provider_1.default {
14968
- constructor() {
14969
- super(...arguments);
14970
- this._reader = new stream_1.default(this._settings);
14971
- }
14972
- read(task) {
14973
- const root = this._getRootDirectory(task);
14974
- const options = this._getReaderOptions(task);
14975
- const entries = [];
14976
- return new Promise((resolve, reject) => {
14977
- const stream = this.api(root, task, options);
14978
- stream.once('error', reject);
14979
- stream.on('data', (entry) => entries.push(options.transform(entry)));
14980
- stream.once('end', () => resolve(entries));
14981
- });
14982
- }
14983
- api(root, task, options) {
14984
- if (task.dynamic) {
14985
- return this._reader.dynamic(root, options);
14986
- }
14987
- return this._reader.static(task.patterns, options);
14878
+ if (whitespace <= previousWhitespace) {
14879
+ let stackIndex = stack.length - 1;
14880
+
14881
+ while(stack[stackIndex] && (whitespace <= stack[stackIndex].depth)) {
14882
+ stack.pop();
14883
+ stackIndex--;
14884
+ }
14988
14885
  }
14989
- }
14990
- exports.default = ProviderAsync;
14991
14886
 
14887
+ // Make note of line's whitespace depth
14992
14888
 
14993
- /***/ }),
14889
+ previousWhitespace = whitespace;
14994
14890
 
14995
- /***/ 52744:
14996
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
14891
+ // Handle new key/value leaf
14997
14892
 
14998
- "use strict";
14893
+ let parts = GEMFILE_KEY_VALUE.exec(line);
14894
+ let key = parts[1].trim();
14895
+ let value = parts[2] || '';
14999
14896
 
15000
- Object.defineProperty(exports, "__esModule", ({ value: true }));
15001
- const utils = __webpack_require__(73290);
15002
- const partial_1 = __webpack_require__(1340);
15003
- class DeepFilter {
15004
- constructor(_settings, _micromatchOptions) {
15005
- this._settings = _settings;
15006
- this._micromatchOptions = _micromatchOptions;
15007
- }
15008
- getFilter(basePath, positive, negative) {
15009
- const matcher = this._getMatcher(positive);
15010
- const negativeRe = this._getNegativePatternsRe(negative);
15011
- return (entry) => this._filter(basePath, entry, matcher, negativeRe);
15012
- }
15013
- _getMatcher(patterns) {
15014
- return new partial_1.default(patterns, this._settings, this._micromatchOptions);
15015
- }
15016
- _getNegativePatternsRe(patterns) {
15017
- const affectDepthOfReadingPatterns = patterns.filter(utils.pattern.isAffectDepthOfReadingPattern);
15018
- return utils.pattern.convertPatternsToRe(affectDepthOfReadingPatterns, this._micromatchOptions);
15019
- }
15020
- _filter(basePath, entry, matcher, negativeRe) {
15021
- if (this._isSkippedByDeep(basePath, entry.path)) {
15022
- return false;
15023
- }
15024
- if (this._isSkippedSymbolicLink(entry)) {
15025
- return false;
14897
+ if (key) {
14898
+
14899
+ // Handle path traversal
14900
+
14901
+ let level = gemfile;
14902
+
14903
+ for (let stackIndex = 0; stackIndex < stack.length; stackIndex++) {
14904
+ if (level[stack[stackIndex].key]) {
14905
+ level = level[stack[stackIndex].key];
15026
14906
  }
15027
- const filepath = utils.path.removeLeadingDotSegment(entry.path);
15028
- if (this._isSkippedByPositivePatterns(filepath, matcher)) {
15029
- return false;
14907
+ }
14908
+
14909
+ // Handle data type inference
14910
+
14911
+ let data = {};
14912
+
14913
+ if (value.indexOf('/') > -1) {
14914
+ data.path = value;
14915
+ } else if (value.indexOf('(') > -1) {
14916
+ if (value[value.length - 1] === '!') {
14917
+ value = value.substring(0, value.length - 1);
14918
+ data.outsourced = true;
15030
14919
  }
15031
- return this._isSkippedByNegativePatterns(filepath, negativeRe);
15032
- }
15033
- _isSkippedByDeep(basePath, entryPath) {
15034
- /**
15035
- * Avoid unnecessary depth calculations when it doesn't matter.
15036
- */
15037
- if (this._settings.deep === Infinity) {
15038
- return false;
15039
- }
15040
- return this._getEntryLevel(basePath, entryPath) >= this._settings.deep;
15041
- }
15042
- _getEntryLevel(basePath, entryPath) {
15043
- const entryPathDepth = entryPath.split('/').length;
15044
- if (basePath === '') {
15045
- return entryPathDepth;
15046
- }
15047
- const basePathDepth = basePath.split('/').length;
15048
- return entryPathDepth - basePathDepth;
15049
- }
15050
- _isSkippedSymbolicLink(entry) {
15051
- return !this._settings.followSymbolicLinks && entry.dirent.isSymbolicLink();
15052
- }
15053
- _isSkippedByPositivePatterns(entryPath, matcher) {
15054
- return !this._settings.baseNameMatch && !matcher.match(entryPath);
15055
- }
15056
- _isSkippedByNegativePatterns(entryPath, patternsRe) {
15057
- return !utils.pattern.matchAny(entryPath, patternsRe);
15058
- }
15059
- }
15060
- exports.default = DeepFilter;
15061
-
15062
-
15063
- /***/ }),
15064
-
15065
- /***/ 93579:
15066
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
15067
-
15068
- "use strict";
15069
-
15070
- Object.defineProperty(exports, "__esModule", ({ value: true }));
15071
- const utils = __webpack_require__(73290);
15072
- class EntryFilter {
15073
- constructor(_settings, _micromatchOptions) {
15074
- this._settings = _settings;
15075
- this._micromatchOptions = _micromatchOptions;
15076
- this.index = new Map();
15077
- }
15078
- getFilter(positive, negative) {
15079
- const positiveRe = utils.pattern.convertPatternsToRe(positive, this._micromatchOptions);
15080
- const negativeRe = utils.pattern.convertPatternsToRe(negative, this._micromatchOptions);
15081
- return (entry) => this._filter(entry, positiveRe, negativeRe);
15082
- }
15083
- _filter(entry, positiveRe, negativeRe) {
15084
- if (this._settings.unique && this._isDuplicateEntry(entry)) {
15085
- return false;
15086
- }
15087
- if (this._onlyFileFilter(entry) || this._onlyDirectoryFilter(entry)) {
15088
- return false;
15089
- }
15090
- if (this._isSkippedByAbsoluteNegativePatterns(entry.path, negativeRe)) {
15091
- return false;
15092
- }
15093
- const filepath = this._settings.baseNameMatch ? entry.name : entry.path;
15094
- const isMatched = this._isMatchToPatterns(filepath, positiveRe) && !this._isMatchToPatterns(entry.path, negativeRe);
15095
- if (this._settings.unique && isMatched) {
15096
- this._createIndexRecord(entry);
15097
- }
15098
- return isMatched;
15099
- }
15100
- _isDuplicateEntry(entry) {
15101
- return this.index.has(entry.path);
15102
- }
15103
- _createIndexRecord(entry) {
15104
- this.index.set(entry.path, undefined);
15105
- }
15106
- _onlyFileFilter(entry) {
15107
- return this._settings.onlyFiles && !entry.dirent.isFile();
15108
- }
15109
- _onlyDirectoryFilter(entry) {
15110
- return this._settings.onlyDirectories && !entry.dirent.isDirectory();
15111
- }
15112
- _isSkippedByAbsoluteNegativePatterns(entryPath, patternsRe) {
15113
- if (!this._settings.absolute) {
15114
- return false;
15115
- }
15116
- const fullpath = utils.path.makeAbsolute(this._settings.cwd, entryPath);
15117
- return utils.pattern.matchAny(fullpath, patternsRe);
15118
- }
15119
- _isMatchToPatterns(entryPath, patternsRe) {
15120
- const filepath = utils.path.removeLeadingDotSegment(entryPath);
15121
- return utils.pattern.matchAny(filepath, patternsRe);
15122
- }
15123
- }
15124
- exports.default = EntryFilter;
15125
-
15126
-
15127
- /***/ }),
15128
-
15129
- /***/ 8520:
15130
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
15131
-
15132
- "use strict";
15133
-
15134
- Object.defineProperty(exports, "__esModule", ({ value: true }));
15135
- const utils = __webpack_require__(73290);
15136
- class ErrorFilter {
15137
- constructor(_settings) {
15138
- this._settings = _settings;
15139
- }
15140
- getFilter() {
15141
- return (error) => this._isNonFatalError(error);
15142
- }
15143
- _isNonFatalError(error) {
15144
- return utils.errno.isEnoentCodeError(error) || this._settings.suppressErrors;
15145
- }
15146
- }
15147
- exports.default = ErrorFilter;
15148
-
15149
-
15150
- /***/ }),
15151
-
15152
- /***/ 45177:
15153
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
15154
-
15155
- "use strict";
15156
-
15157
- Object.defineProperty(exports, "__esModule", ({ value: true }));
15158
- const utils = __webpack_require__(73290);
15159
- class Matcher {
15160
- constructor(_patterns, _settings, _micromatchOptions) {
15161
- this._patterns = _patterns;
15162
- this._settings = _settings;
15163
- this._micromatchOptions = _micromatchOptions;
15164
- this._storage = [];
15165
- this._fillStorage();
15166
- }
15167
- _fillStorage() {
15168
- /**
15169
- * The original pattern may include `{,*,**,a/*}`, which will lead to problems with matching (unresolved level).
15170
- * So, before expand patterns with brace expansion into separated patterns.
15171
- */
15172
- const patterns = utils.pattern.expandPatternsWithBraceExpansion(this._patterns);
15173
- for (const pattern of patterns) {
15174
- const segments = this._getPatternSegments(pattern);
15175
- const sections = this._splitSegmentsIntoSections(segments);
15176
- this._storage.push({
15177
- complete: sections.length <= 1,
15178
- pattern,
15179
- segments,
15180
- sections
15181
- });
15182
- }
15183
- }
15184
- _getPatternSegments(pattern) {
15185
- const parts = utils.pattern.getPatternParts(pattern, this._micromatchOptions);
15186
- return parts.map((part) => {
15187
- const dynamic = utils.pattern.isDynamicPattern(part, this._settings);
15188
- if (!dynamic) {
15189
- return {
15190
- dynamic: false,
15191
- pattern: part
15192
- };
15193
- }
15194
- return {
15195
- dynamic: true,
15196
- pattern: part,
15197
- patternRe: utils.pattern.makeRe(part, this._micromatchOptions)
15198
- };
15199
- });
15200
- }
15201
- _splitSegmentsIntoSections(segments) {
15202
- return utils.array.splitWhen(segments, (segment) => segment.dynamic && utils.pattern.hasGlobStar(segment.pattern));
15203
- }
15204
- }
15205
- exports.default = Matcher;
15206
-
15207
-
15208
- /***/ }),
15209
-
15210
- /***/ 1340:
15211
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
15212
-
15213
- "use strict";
15214
-
15215
- Object.defineProperty(exports, "__esModule", ({ value: true }));
15216
- const matcher_1 = __webpack_require__(45177);
15217
- class PartialMatcher extends matcher_1.default {
15218
- match(filepath) {
15219
- const parts = filepath.split('/');
15220
- const levels = parts.length;
15221
- const patterns = this._storage.filter((info) => !info.complete || info.segments.length > levels);
15222
- for (const pattern of patterns) {
15223
- const section = pattern.sections[0];
15224
- /**
15225
- * In this case, the pattern has a globstar and we must read all directories unconditionally,
15226
- * but only if the level has reached the end of the first group.
15227
- *
15228
- * fixtures/{a,b}/**
15229
- * ^ true/false ^ always true
15230
- */
15231
- if (!pattern.complete && levels > section.length) {
15232
- return true;
15233
- }
15234
- const match = parts.every((part, index) => {
15235
- const segment = pattern.segments[index];
15236
- if (segment.dynamic && segment.patternRe.test(part)) {
15237
- return true;
15238
- }
15239
- if (!segment.dynamic && segment.pattern === part) {
15240
- return true;
15241
- }
15242
- return false;
15243
- });
15244
- if (match) {
15245
- return true;
15246
- }
15247
- }
15248
- return false;
15249
- }
15250
- }
15251
- exports.default = PartialMatcher;
15252
-
15253
-
15254
- /***/ }),
15255
-
15256
- /***/ 29834:
15257
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
15258
-
15259
- "use strict";
15260
-
15261
- Object.defineProperty(exports, "__esModule", ({ value: true }));
15262
- const path = __webpack_require__(85622);
15263
- const deep_1 = __webpack_require__(52744);
15264
- const entry_1 = __webpack_require__(93579);
15265
- const error_1 = __webpack_require__(8520);
15266
- const entry_2 = __webpack_require__(54081);
15267
- class Provider {
15268
- constructor(_settings) {
15269
- this._settings = _settings;
15270
- this.errorFilter = new error_1.default(this._settings);
15271
- this.entryFilter = new entry_1.default(this._settings, this._getMicromatchOptions());
15272
- this.deepFilter = new deep_1.default(this._settings, this._getMicromatchOptions());
15273
- this.entryTransformer = new entry_2.default(this._settings);
15274
- }
15275
- _getRootDirectory(task) {
15276
- return path.resolve(this._settings.cwd, task.base);
15277
- }
15278
- _getReaderOptions(task) {
15279
- const basePath = task.base === '.' ? '' : task.base;
15280
- return {
15281
- basePath,
15282
- pathSegmentSeparator: '/',
15283
- concurrency: this._settings.concurrency,
15284
- deepFilter: this.deepFilter.getFilter(basePath, task.positive, task.negative),
15285
- entryFilter: this.entryFilter.getFilter(task.positive, task.negative),
15286
- errorFilter: this.errorFilter.getFilter(),
15287
- followSymbolicLinks: this._settings.followSymbolicLinks,
15288
- fs: this._settings.fs,
15289
- stats: this._settings.stats,
15290
- throwErrorOnBrokenSymbolicLink: this._settings.throwErrorOnBrokenSymbolicLink,
15291
- transform: this.entryTransformer.getTransformer()
15292
- };
15293
- }
15294
- _getMicromatchOptions() {
15295
- return {
15296
- dot: this._settings.dot,
15297
- matchBase: this._settings.baseNameMatch,
15298
- nobrace: !this._settings.braceExpansion,
15299
- nocase: !this._settings.caseSensitiveMatch,
15300
- noext: !this._settings.extglob,
15301
- noglobstar: !this._settings.globstar,
15302
- posix: true,
15303
- strictSlashes: false
15304
- };
15305
- }
15306
- }
15307
- exports.default = Provider;
15308
-
15309
-
15310
- /***/ }),
15311
-
15312
- /***/ 3480:
15313
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
15314
-
15315
- "use strict";
15316
-
15317
- Object.defineProperty(exports, "__esModule", ({ value: true }));
15318
- const stream_1 = __webpack_require__(92413);
15319
- const stream_2 = __webpack_require__(3986);
15320
- const provider_1 = __webpack_require__(29834);
15321
- class ProviderStream extends provider_1.default {
15322
- constructor() {
15323
- super(...arguments);
15324
- this._reader = new stream_2.default(this._settings);
15325
- }
15326
- read(task) {
15327
- const root = this._getRootDirectory(task);
15328
- const options = this._getReaderOptions(task);
15329
- const source = this.api(root, task, options);
15330
- const destination = new stream_1.Readable({ objectMode: true, read: () => { } });
15331
- source
15332
- .once('error', (error) => destination.emit('error', error))
15333
- .on('data', (entry) => destination.emit('data', options.transform(entry)))
15334
- .once('end', () => destination.emit('end'));
15335
- destination
15336
- .once('close', () => source.destroy());
15337
- return destination;
15338
- }
15339
- api(root, task, options) {
15340
- if (task.dynamic) {
15341
- return this._reader.dynamic(root, options);
15342
- }
15343
- return this._reader.static(task.patterns, options);
15344
- }
15345
- }
15346
- exports.default = ProviderStream;
15347
-
15348
-
15349
- /***/ }),
15350
-
15351
- /***/ 62512:
15352
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
15353
-
15354
- "use strict";
15355
-
15356
- Object.defineProperty(exports, "__esModule", ({ value: true }));
15357
- const sync_1 = __webpack_require__(94311);
15358
- const provider_1 = __webpack_require__(29834);
15359
- class ProviderSync extends provider_1.default {
15360
- constructor() {
15361
- super(...arguments);
15362
- this._reader = new sync_1.default(this._settings);
15363
- }
15364
- read(task) {
15365
- const root = this._getRootDirectory(task);
15366
- const options = this._getReaderOptions(task);
15367
- const entries = this.api(root, task, options);
15368
- return entries.map(options.transform);
15369
- }
15370
- api(root, task, options) {
15371
- if (task.dynamic) {
15372
- return this._reader.dynamic(root, options);
15373
- }
15374
- return this._reader.static(task.patterns, options);
15375
- }
15376
- }
15377
- exports.default = ProviderSync;
15378
-
15379
-
15380
- /***/ }),
15381
-
15382
- /***/ 54081:
15383
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
15384
-
15385
- "use strict";
15386
-
15387
- Object.defineProperty(exports, "__esModule", ({ value: true }));
15388
- const utils = __webpack_require__(73290);
15389
- class EntryTransformer {
15390
- constructor(_settings) {
15391
- this._settings = _settings;
15392
- }
15393
- getTransformer() {
15394
- return (entry) => this._transform(entry);
15395
- }
15396
- _transform(entry) {
15397
- let filepath = entry.path;
15398
- if (this._settings.absolute) {
15399
- filepath = utils.path.makeAbsolute(this._settings.cwd, filepath);
15400
- filepath = utils.path.unixify(filepath);
15401
- }
15402
- if (this._settings.markDirectories && entry.dirent.isDirectory()) {
15403
- filepath += '/';
15404
- }
15405
- if (!this._settings.objectMode) {
15406
- return filepath;
15407
- }
15408
- return Object.assign(Object.assign({}, entry), { path: filepath });
15409
- }
15410
- }
15411
- exports.default = EntryTransformer;
15412
-
15413
-
15414
- /***/ }),
15415
-
15416
- /***/ 35346:
15417
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
15418
-
15419
- "use strict";
15420
-
15421
- Object.defineProperty(exports, "__esModule", ({ value: true }));
15422
- const path = __webpack_require__(85622);
15423
- const fsStat = __webpack_require__(66203);
15424
- const utils = __webpack_require__(73290);
15425
- class Reader {
15426
- constructor(_settings) {
15427
- this._settings = _settings;
15428
- this._fsStatSettings = new fsStat.Settings({
15429
- followSymbolicLink: this._settings.followSymbolicLinks,
15430
- fs: this._settings.fs,
15431
- throwErrorOnBrokenSymbolicLink: this._settings.followSymbolicLinks
15432
- });
15433
- }
15434
- _getFullEntryPath(filepath) {
15435
- return path.resolve(this._settings.cwd, filepath);
15436
- }
15437
- _makeEntry(stats, pattern) {
15438
- const entry = {
15439
- name: pattern,
15440
- path: pattern,
15441
- dirent: utils.fs.createDirentFromStats(pattern, stats)
15442
- };
15443
- if (this._settings.stats) {
15444
- entry.stats = stats;
15445
- }
15446
- return entry;
15447
- }
15448
- _isFatalError(error) {
15449
- return !utils.errno.isEnoentCodeError(error) && !this._settings.suppressErrors;
15450
- }
15451
- }
15452
- exports.default = Reader;
15453
-
15454
-
15455
- /***/ }),
15456
-
15457
- /***/ 3986:
15458
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
15459
-
15460
- "use strict";
15461
-
15462
- Object.defineProperty(exports, "__esModule", ({ value: true }));
15463
- const stream_1 = __webpack_require__(92413);
15464
- const fsStat = __webpack_require__(66203);
15465
- const fsWalk = __webpack_require__(45439);
15466
- const reader_1 = __webpack_require__(35346);
15467
- class ReaderStream extends reader_1.default {
15468
- constructor() {
15469
- super(...arguments);
15470
- this._walkStream = fsWalk.walkStream;
15471
- this._stat = fsStat.stat;
15472
- }
15473
- dynamic(root, options) {
15474
- return this._walkStream(root, options);
15475
- }
15476
- static(patterns, options) {
15477
- const filepaths = patterns.map(this._getFullEntryPath, this);
15478
- const stream = new stream_1.PassThrough({ objectMode: true });
15479
- stream._write = (index, _enc, done) => {
15480
- return this._getEntry(filepaths[index], patterns[index], options)
15481
- .then((entry) => {
15482
- if (entry !== null && options.entryFilter(entry)) {
15483
- stream.push(entry);
15484
- }
15485
- if (index === filepaths.length - 1) {
15486
- stream.end();
15487
- }
15488
- done();
15489
- })
15490
- .catch(done);
15491
- };
15492
- for (let i = 0; i < filepaths.length; i++) {
15493
- stream.write(i);
15494
- }
15495
- return stream;
15496
- }
15497
- _getEntry(filepath, pattern, options) {
15498
- return this._getStat(filepath)
15499
- .then((stats) => this._makeEntry(stats, pattern))
15500
- .catch((error) => {
15501
- if (options.errorFilter(error)) {
15502
- return null;
15503
- }
15504
- throw error;
15505
- });
15506
- }
15507
- _getStat(filepath) {
15508
- return new Promise((resolve, reject) => {
15509
- this._stat(filepath, this._fsStatSettings, (error, stats) => {
15510
- return error === null ? resolve(stats) : reject(error);
15511
- });
15512
- });
15513
- }
15514
- }
15515
- exports.default = ReaderStream;
15516
-
15517
-
15518
- /***/ }),
15519
-
15520
- /***/ 94311:
15521
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
15522
-
15523
- "use strict";
15524
-
15525
- Object.defineProperty(exports, "__esModule", ({ value: true }));
15526
- const fsStat = __webpack_require__(66203);
15527
- const fsWalk = __webpack_require__(45439);
15528
- const reader_1 = __webpack_require__(35346);
15529
- class ReaderSync extends reader_1.default {
15530
- constructor() {
15531
- super(...arguments);
15532
- this._walkSync = fsWalk.walkSync;
15533
- this._statSync = fsStat.statSync;
15534
- }
15535
- dynamic(root, options) {
15536
- return this._walkSync(root, options);
15537
- }
15538
- static(patterns, options) {
15539
- const entries = [];
15540
- for (const pattern of patterns) {
15541
- const filepath = this._getFullEntryPath(pattern);
15542
- const entry = this._getEntry(filepath, pattern, options);
15543
- if (entry === null || !options.entryFilter(entry)) {
15544
- continue;
15545
- }
15546
- entries.push(entry);
15547
- }
15548
- return entries;
15549
- }
15550
- _getEntry(filepath, pattern, options) {
15551
- try {
15552
- const stats = this._getStat(filepath);
15553
- return this._makeEntry(stats, pattern);
15554
- }
15555
- catch (error) {
15556
- if (options.errorFilter(error)) {
15557
- return null;
15558
- }
15559
- throw error;
15560
- }
15561
- }
15562
- _getStat(filepath) {
15563
- return this._statSync(filepath, this._fsStatSettings);
15564
- }
15565
- }
15566
- exports.default = ReaderSync;
15567
-
15568
-
15569
- /***/ }),
15570
-
15571
- /***/ 95879:
15572
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
15573
-
15574
- "use strict";
15575
-
15576
- Object.defineProperty(exports, "__esModule", ({ value: true }));
15577
- exports.DEFAULT_FILE_SYSTEM_ADAPTER = void 0;
15578
- const fs = __webpack_require__(35747);
15579
- const os = __webpack_require__(12087);
15580
- /**
15581
- * The `os.cpus` method can return zero. We expect the number of cores to be greater than zero.
15582
- * https://github.com/nodejs/node/blob/7faeddf23a98c53896f8b574a6e66589e8fb1eb8/lib/os.js#L106-L107
15583
- */
15584
- const CPU_COUNT = Math.max(os.cpus().length, 1);
15585
- exports.DEFAULT_FILE_SYSTEM_ADAPTER = {
15586
- lstat: fs.lstat,
15587
- lstatSync: fs.lstatSync,
15588
- stat: fs.stat,
15589
- statSync: fs.statSync,
15590
- readdir: fs.readdir,
15591
- readdirSync: fs.readdirSync
15592
- };
15593
- class Settings {
15594
- constructor(_options = {}) {
15595
- this._options = _options;
15596
- this.absolute = this._getValue(this._options.absolute, false);
15597
- this.baseNameMatch = this._getValue(this._options.baseNameMatch, false);
15598
- this.braceExpansion = this._getValue(this._options.braceExpansion, true);
15599
- this.caseSensitiveMatch = this._getValue(this._options.caseSensitiveMatch, true);
15600
- this.concurrency = this._getValue(this._options.concurrency, CPU_COUNT);
15601
- this.cwd = this._getValue(this._options.cwd, process.cwd());
15602
- this.deep = this._getValue(this._options.deep, Infinity);
15603
- this.dot = this._getValue(this._options.dot, false);
15604
- this.extglob = this._getValue(this._options.extglob, true);
15605
- this.followSymbolicLinks = this._getValue(this._options.followSymbolicLinks, true);
15606
- this.fs = this._getFileSystemMethods(this._options.fs);
15607
- this.globstar = this._getValue(this._options.globstar, true);
15608
- this.ignore = this._getValue(this._options.ignore, []);
15609
- this.markDirectories = this._getValue(this._options.markDirectories, false);
15610
- this.objectMode = this._getValue(this._options.objectMode, false);
15611
- this.onlyDirectories = this._getValue(this._options.onlyDirectories, false);
15612
- this.onlyFiles = this._getValue(this._options.onlyFiles, true);
15613
- this.stats = this._getValue(this._options.stats, false);
15614
- this.suppressErrors = this._getValue(this._options.suppressErrors, false);
15615
- this.throwErrorOnBrokenSymbolicLink = this._getValue(this._options.throwErrorOnBrokenSymbolicLink, false);
15616
- this.unique = this._getValue(this._options.unique, true);
15617
- if (this.onlyDirectories) {
15618
- this.onlyFiles = false;
15619
- }
15620
- if (this.stats) {
15621
- this.objectMode = true;
15622
- }
15623
- }
15624
- _getValue(option, value) {
15625
- return option === undefined ? value : option;
15626
- }
15627
- _getFileSystemMethods(methods = {}) {
15628
- return Object.assign(Object.assign({}, exports.DEFAULT_FILE_SYSTEM_ADAPTER), methods);
15629
- }
15630
- }
15631
- exports.default = Settings;
15632
-
15633
-
15634
- /***/ }),
15635
-
15636
- /***/ 86465:
15637
- /***/ ((__unused_webpack_module, exports) => {
15638
-
15639
- "use strict";
15640
-
15641
- Object.defineProperty(exports, "__esModule", ({ value: true }));
15642
- exports.splitWhen = exports.flatten = void 0;
15643
- function flatten(items) {
15644
- return items.reduce((collection, item) => [].concat(collection, item), []);
15645
- }
15646
- exports.flatten = flatten;
15647
- function splitWhen(items, predicate) {
15648
- const result = [[]];
15649
- let groupIndex = 0;
15650
- for (const item of items) {
15651
- if (predicate(item)) {
15652
- groupIndex++;
15653
- result[groupIndex] = [];
15654
- }
15655
- else {
15656
- result[groupIndex].push(item);
15657
- }
15658
- }
15659
- return result;
15660
- }
15661
- exports.splitWhen = splitWhen;
15662
-
15663
-
15664
- /***/ }),
15665
-
15666
- /***/ 66049:
15667
- /***/ ((__unused_webpack_module, exports) => {
15668
-
15669
- "use strict";
15670
-
15671
- Object.defineProperty(exports, "__esModule", ({ value: true }));
15672
- exports.isEnoentCodeError = void 0;
15673
- function isEnoentCodeError(error) {
15674
- return error.code === 'ENOENT';
15675
- }
15676
- exports.isEnoentCodeError = isEnoentCodeError;
15677
-
15678
-
15679
- /***/ }),
15680
-
15681
- /***/ 4906:
15682
- /***/ ((__unused_webpack_module, exports) => {
15683
-
15684
- "use strict";
15685
-
15686
- Object.defineProperty(exports, "__esModule", ({ value: true }));
15687
- exports.createDirentFromStats = void 0;
15688
- class DirentFromStats {
15689
- constructor(name, stats) {
15690
- this.name = name;
15691
- this.isBlockDevice = stats.isBlockDevice.bind(stats);
15692
- this.isCharacterDevice = stats.isCharacterDevice.bind(stats);
15693
- this.isDirectory = stats.isDirectory.bind(stats);
15694
- this.isFIFO = stats.isFIFO.bind(stats);
15695
- this.isFile = stats.isFile.bind(stats);
15696
- this.isSocket = stats.isSocket.bind(stats);
15697
- this.isSymbolicLink = stats.isSymbolicLink.bind(stats);
15698
- }
15699
- }
15700
- function createDirentFromStats(name, stats) {
15701
- return new DirentFromStats(name, stats);
15702
- }
15703
- exports.createDirentFromStats = createDirentFromStats;
15704
-
15705
-
15706
- /***/ }),
15707
-
15708
- /***/ 73290:
15709
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
15710
-
15711
- "use strict";
15712
-
15713
- Object.defineProperty(exports, "__esModule", ({ value: true }));
15714
- exports.string = exports.stream = exports.pattern = exports.path = exports.fs = exports.errno = exports.array = void 0;
15715
- const array = __webpack_require__(86465);
15716
- exports.array = array;
15717
- const errno = __webpack_require__(66049);
15718
- exports.errno = errno;
15719
- const fs = __webpack_require__(4906);
15720
- exports.fs = fs;
15721
- const path = __webpack_require__(55830);
15722
- exports.path = path;
15723
- const pattern = __webpack_require__(10038);
15724
- exports.pattern = pattern;
15725
- const stream = __webpack_require__(61726);
15726
- exports.stream = stream;
15727
- const string = __webpack_require__(63757);
15728
- exports.string = string;
15729
-
15730
-
15731
- /***/ }),
15732
-
15733
- /***/ 55830:
15734
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
15735
-
15736
- "use strict";
15737
-
15738
- Object.defineProperty(exports, "__esModule", ({ value: true }));
15739
- exports.removeLeadingDotSegment = exports.escape = exports.makeAbsolute = exports.unixify = void 0;
15740
- const path = __webpack_require__(85622);
15741
- const LEADING_DOT_SEGMENT_CHARACTERS_COUNT = 2; // ./ or .\\
15742
- const UNESCAPED_GLOB_SYMBOLS_RE = /(\\?)([()*?[\]{|}]|^!|[!+@](?=\())/g;
15743
- /**
15744
- * Designed to work only with simple paths: `dir\\file`.
15745
- */
15746
- function unixify(filepath) {
15747
- return filepath.replace(/\\/g, '/');
15748
- }
15749
- exports.unixify = unixify;
15750
- function makeAbsolute(cwd, filepath) {
15751
- return path.resolve(cwd, filepath);
15752
- }
15753
- exports.makeAbsolute = makeAbsolute;
15754
- function escape(pattern) {
15755
- return pattern.replace(UNESCAPED_GLOB_SYMBOLS_RE, '\\$2');
15756
- }
15757
- exports.escape = escape;
15758
- function removeLeadingDotSegment(entry) {
15759
- // We do not use `startsWith` because this is 10x slower than current implementation for some cases.
15760
- // eslint-disable-next-line @typescript-eslint/prefer-string-starts-ends-with
15761
- if (entry.charAt(0) === '.') {
15762
- const secondCharactery = entry.charAt(1);
15763
- if (secondCharactery === '/' || secondCharactery === '\\') {
15764
- return entry.slice(LEADING_DOT_SEGMENT_CHARACTERS_COUNT);
15765
- }
15766
- }
15767
- return entry;
15768
- }
15769
- exports.removeLeadingDotSegment = removeLeadingDotSegment;
15770
-
15771
-
15772
- /***/ }),
15773
-
15774
- /***/ 10038:
15775
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
15776
-
15777
- "use strict";
15778
-
15779
- Object.defineProperty(exports, "__esModule", ({ value: true }));
15780
- exports.matchAny = exports.convertPatternsToRe = exports.makeRe = exports.getPatternParts = exports.expandBraceExpansion = exports.expandPatternsWithBraceExpansion = exports.isAffectDepthOfReadingPattern = exports.endsWithSlashGlobStar = exports.hasGlobStar = exports.getBaseDirectory = exports.getPositivePatterns = exports.getNegativePatterns = exports.isPositivePattern = exports.isNegativePattern = exports.convertToNegativePattern = exports.convertToPositivePattern = exports.isDynamicPattern = exports.isStaticPattern = void 0;
15781
- const path = __webpack_require__(85622);
15782
- const globParent = __webpack_require__(29807);
15783
- const micromatch = __webpack_require__(70850);
15784
- const picomatch = __webpack_require__(59444);
15785
- const GLOBSTAR = '**';
15786
- const ESCAPE_SYMBOL = '\\';
15787
- const COMMON_GLOB_SYMBOLS_RE = /[*?]|^!/;
15788
- const REGEX_CHARACTER_CLASS_SYMBOLS_RE = /\[.*]/;
15789
- const REGEX_GROUP_SYMBOLS_RE = /(?:^|[^!*+?@])\(.*\|.*\)/;
15790
- const GLOB_EXTENSION_SYMBOLS_RE = /[!*+?@]\(.*\)/;
15791
- const BRACE_EXPANSIONS_SYMBOLS_RE = /{.*(?:,|\.\.).*}/;
15792
- function isStaticPattern(pattern, options = {}) {
15793
- return !isDynamicPattern(pattern, options);
15794
- }
15795
- exports.isStaticPattern = isStaticPattern;
15796
- function isDynamicPattern(pattern, options = {}) {
15797
- /**
15798
- * A special case with an empty string is necessary for matching patterns that start with a forward slash.
15799
- * An empty string cannot be a dynamic pattern.
15800
- * For example, the pattern `/lib/*` will be spread into parts: '', 'lib', '*'.
15801
- */
15802
- if (pattern === '') {
15803
- return false;
15804
- }
15805
- /**
15806
- * When the `caseSensitiveMatch` option is disabled, all patterns must be marked as dynamic, because we cannot check
15807
- * filepath directly (without read directory).
15808
- */
15809
- if (options.caseSensitiveMatch === false || pattern.includes(ESCAPE_SYMBOL)) {
15810
- return true;
15811
- }
15812
- if (COMMON_GLOB_SYMBOLS_RE.test(pattern) || REGEX_CHARACTER_CLASS_SYMBOLS_RE.test(pattern) || REGEX_GROUP_SYMBOLS_RE.test(pattern)) {
15813
- return true;
15814
- }
15815
- if (options.extglob !== false && GLOB_EXTENSION_SYMBOLS_RE.test(pattern)) {
15816
- return true;
15817
- }
15818
- if (options.braceExpansion !== false && BRACE_EXPANSIONS_SYMBOLS_RE.test(pattern)) {
15819
- return true;
15820
- }
15821
- return false;
15822
- }
15823
- exports.isDynamicPattern = isDynamicPattern;
15824
- function convertToPositivePattern(pattern) {
15825
- return isNegativePattern(pattern) ? pattern.slice(1) : pattern;
15826
- }
15827
- exports.convertToPositivePattern = convertToPositivePattern;
15828
- function convertToNegativePattern(pattern) {
15829
- return '!' + pattern;
15830
- }
15831
- exports.convertToNegativePattern = convertToNegativePattern;
15832
- function isNegativePattern(pattern) {
15833
- return pattern.startsWith('!') && pattern[1] !== '(';
15834
- }
15835
- exports.isNegativePattern = isNegativePattern;
15836
- function isPositivePattern(pattern) {
15837
- return !isNegativePattern(pattern);
15838
- }
15839
- exports.isPositivePattern = isPositivePattern;
15840
- function getNegativePatterns(patterns) {
15841
- return patterns.filter(isNegativePattern);
15842
- }
15843
- exports.getNegativePatterns = getNegativePatterns;
15844
- function getPositivePatterns(patterns) {
15845
- return patterns.filter(isPositivePattern);
15846
- }
15847
- exports.getPositivePatterns = getPositivePatterns;
15848
- function getBaseDirectory(pattern) {
15849
- return globParent(pattern, { flipBackslashes: false });
15850
- }
15851
- exports.getBaseDirectory = getBaseDirectory;
15852
- function hasGlobStar(pattern) {
15853
- return pattern.includes(GLOBSTAR);
15854
- }
15855
- exports.hasGlobStar = hasGlobStar;
15856
- function endsWithSlashGlobStar(pattern) {
15857
- return pattern.endsWith('/' + GLOBSTAR);
15858
- }
15859
- exports.endsWithSlashGlobStar = endsWithSlashGlobStar;
15860
- function isAffectDepthOfReadingPattern(pattern) {
15861
- const basename = path.basename(pattern);
15862
- return endsWithSlashGlobStar(pattern) || isStaticPattern(basename);
15863
- }
15864
- exports.isAffectDepthOfReadingPattern = isAffectDepthOfReadingPattern;
15865
- function expandPatternsWithBraceExpansion(patterns) {
15866
- return patterns.reduce((collection, pattern) => {
15867
- return collection.concat(expandBraceExpansion(pattern));
15868
- }, []);
15869
- }
15870
- exports.expandPatternsWithBraceExpansion = expandPatternsWithBraceExpansion;
15871
- function expandBraceExpansion(pattern) {
15872
- return micromatch.braces(pattern, {
15873
- expand: true,
15874
- nodupes: true
15875
- });
15876
- }
15877
- exports.expandBraceExpansion = expandBraceExpansion;
15878
- function getPatternParts(pattern, options) {
15879
- let { parts } = picomatch.scan(pattern, Object.assign(Object.assign({}, options), { parts: true }));
15880
- /**
15881
- * The scan method returns an empty array in some cases.
15882
- * See micromatch/picomatch#58 for more details.
15883
- */
15884
- if (parts.length === 0) {
15885
- parts = [pattern];
15886
- }
15887
- /**
15888
- * The scan method does not return an empty part for the pattern with a forward slash.
15889
- * This is another part of micromatch/picomatch#58.
15890
- */
15891
- if (parts[0].startsWith('/')) {
15892
- parts[0] = parts[0].slice(1);
15893
- parts.unshift('');
15894
- }
15895
- return parts;
15896
- }
15897
- exports.getPatternParts = getPatternParts;
15898
- function makeRe(pattern, options) {
15899
- return micromatch.makeRe(pattern, options);
15900
- }
15901
- exports.makeRe = makeRe;
15902
- function convertPatternsToRe(patterns, options) {
15903
- return patterns.map((pattern) => makeRe(pattern, options));
15904
- }
15905
- exports.convertPatternsToRe = convertPatternsToRe;
15906
- function matchAny(entry, patternsRe) {
15907
- return patternsRe.some((patternRe) => patternRe.test(entry));
15908
- }
15909
- exports.matchAny = matchAny;
15910
-
15911
-
15912
- /***/ }),
15913
-
15914
- /***/ 61726:
15915
- /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
15916
-
15917
- "use strict";
15918
-
15919
- Object.defineProperty(exports, "__esModule", ({ value: true }));
15920
- exports.merge = void 0;
15921
- const merge2 = __webpack_require__(60155);
15922
- function merge(streams) {
15923
- const mergedStream = merge2(streams);
15924
- streams.forEach((stream) => {
15925
- stream.once('error', (error) => mergedStream.emit('error', error));
15926
- });
15927
- mergedStream.once('close', () => propagateCloseEventToSources(streams));
15928
- mergedStream.once('end', () => propagateCloseEventToSources(streams));
15929
- return mergedStream;
15930
- }
15931
- exports.merge = merge;
15932
- function propagateCloseEventToSources(streams) {
15933
- streams.forEach((stream) => stream.emit('close'));
15934
- }
15935
-
15936
-
15937
- /***/ }),
15938
-
15939
- /***/ 63757:
15940
- /***/ ((__unused_webpack_module, exports) => {
15941
-
15942
- "use strict";
15943
-
15944
- Object.defineProperty(exports, "__esModule", ({ value: true }));
15945
- exports.isEmpty = exports.isString = void 0;
15946
- function isString(input) {
15947
- return typeof input === 'string';
15948
- }
15949
- exports.isString = isString;
15950
- function isEmpty(input) {
15951
- return input === '';
15952
- }
15953
- exports.isEmpty = isEmpty;
15954
-
15955
-
15956
- /***/ }),
15957
-
15958
- /***/ 10635:
15959
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
15960
-
15961
- "use strict";
15962
-
15963
-
15964
- const fs = __webpack_require__(35747);
15965
- const path = __webpack_require__(85622);
15966
- const assert = __webpack_require__(42357);
15967
-
15968
- const GEMFILE_DEFAULT_LOCATION = path.resolve(process.cwd(), 'Gemfile.lock');
15969
- const WHITESPACE = /^(\s*)/;
15970
- const GEMFILE_KEY_VALUE = /^\s*([^:(]*)\s*\:*\s*(.*)/;
15971
- const ORIGINS = ['GEM', 'GIT', 'PATH'];
15972
- const RUBY = /^ruby\s(.*)/;
15973
-
15974
- module.exports = {
15975
- interpret,
15976
- parse,
15977
- parseSync
15978
- };
15979
-
15980
- function interpret(string, extractMeta) {
15981
- assert(
15982
- typeof string === 'string',
15983
- 'gemfile.interpret expects a UTF-8 Gemfile.lock string source.'
15984
- );
15985
-
15986
- const gemfileMeta = {};
15987
-
15988
- let line;
15989
- let index = 0;
15990
- let previousWhitespace = -1;
15991
- let keyCount = {};
15992
- let gemfile = {};
15993
- let lines = string.split('\n');
15994
- let stack = [];
15995
-
15996
- while((line = lines[index++]) !== undefined) {
15997
-
15998
- // Handle depth stack changes
15999
-
16000
- let whitespace = WHITESPACE.exec(line)[1].length;
16001
-
16002
- if (whitespace <= previousWhitespace) {
16003
- let stackIndex = stack.length - 1;
16004
-
16005
- while(stack[stackIndex] && (whitespace <= stack[stackIndex].depth)) {
16006
- stack.pop();
16007
- stackIndex--;
16008
- }
16009
- }
16010
-
16011
- // Make note of line's whitespace depth
16012
-
16013
- previousWhitespace = whitespace;
16014
-
16015
- // Handle new key/value leaf
16016
-
16017
- let parts = GEMFILE_KEY_VALUE.exec(line);
16018
- let key = parts[1].trim();
16019
- let value = parts[2] || '';
16020
-
16021
- if (key) {
16022
-
16023
- // Handle path traversal
16024
-
16025
- let level = gemfile;
16026
-
16027
- for (let stackIndex = 0; stackIndex < stack.length; stackIndex++) {
16028
- if (level[stack[stackIndex].key]) {
16029
- level = level[stack[stackIndex].key];
16030
- }
16031
- }
16032
-
16033
- // Handle data type inference
16034
-
16035
- let data = {};
16036
-
16037
- if (value.indexOf('/') > -1) {
16038
- data.path = value;
16039
- } else if (value.indexOf('(') > -1) {
16040
- if (value[value.length - 1] === '!') {
16041
- value = value.substring(0, value.length - 1);
16042
- data.outsourced = true;
16043
- }
16044
-
16045
- if (value[1] !== ')') {
16046
- data.version = value.substring(1, value.length - 1);
14920
+
14921
+ if (value[1] !== ')') {
14922
+ data.version = value.substring(1, value.length - 1);
16047
14923
  }
16048
14924
  } else if (/\b[0-9a-f]{7,40}\b/.test(value)) {
16049
14925
  data.sha = value;
@@ -16143,56 +15019,6 @@ function parseSync(path, extractMeta) {
16143
15019
  }
16144
15020
 
16145
15021
 
16146
- /***/ }),
16147
-
16148
- /***/ 29807:
16149
- /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
16150
-
16151
- "use strict";
16152
-
16153
-
16154
- var isGlob = __webpack_require__(46830);
16155
- var pathPosixDirname = __webpack_require__(85622).posix.dirname;
16156
- var isWin32 = __webpack_require__(12087).platform() === 'win32';
16157
-
16158
- var slash = '/';
16159
- var backslash = /\\/g;
16160
- var enclosure = /[\{\[].*\/.*[\}\]]$/;
16161
- var globby = /(^|[^\\])([\{\[]|\([^\)]+$)/;
16162
- var escaped = /\\([\!\*\?\|\[\]\(\)\{\}])/g;
16163
-
16164
- /**
16165
- * @param {string} str
16166
- * @param {Object} opts
16167
- * @param {boolean} [opts.flipBackslashes=true]
16168
- * @returns {string}
16169
- */
16170
- module.exports = function globParent(str, opts) {
16171
- var options = Object.assign({ flipBackslashes: true }, opts);
16172
-
16173
- // flip windows path separators
16174
- if (options.flipBackslashes && isWin32 && str.indexOf(slash) < 0) {
16175
- str = str.replace(backslash, slash);
16176
- }
16177
-
16178
- // special case for strings ending in enclosure containing path separator
16179
- if (enclosure.test(str)) {
16180
- str += slash;
16181
- }
16182
-
16183
- // preserves full path in case of trailing path separator
16184
- str += 'a';
16185
-
16186
- // remove path parts that are globby
16187
- do {
16188
- str = pathPosixDirname(str);
16189
- } while (isGlob(str) || globby.test(str));
16190
-
16191
- // remove escape chars and return result
16192
- return str.replace(escaped, '$1');
16193
- };
16194
-
16195
-
16196
15022
  /***/ }),
16197
15023
 
16198
15024
  /***/ 39322: