snyk 1.751.0 → 1.752.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.
@@ -172450,6 +172450,18 @@ exports.spawn = spawn;
172450
172450
 
172451
172451
  /***/ }),
172452
172452
 
172453
+ /***/ 51469:
172454
+ /***/ ((__unused_webpack_module, exports) => {
172455
+
172456
+ "use strict";
172457
+
172458
+ Object.defineProperty(exports, "__esModule", ({ value: true }));
172459
+ exports.MAX_SUPPORTED_FILE_SIZE = void 0;
172460
+ exports.MAX_SUPPORTED_FILE_SIZE = 2 * 1024 * 1024 * 1024 - 1;
172461
+ //# sourceMappingURL=common.js.map
172462
+
172463
+ /***/ }),
172464
+
172453
172465
  /***/ 36583:
172454
172466
  /***/ ((__unused_webpack_module, exports, __webpack_require__) => {
172455
172467
 
@@ -172872,41 +172884,50 @@ function getSingleDigest(fileContents) {
172872
172884
  "use strict";
172873
172885
 
172874
172886
  Object.defineProperty(exports, "__esModule", ({ value: true }));
172875
- exports.find = void 0;
172887
+ exports.extractFilePaths = exports.find = exports.stat = void 0;
172876
172888
  const fs = __webpack_require__(35747);
172877
172889
  const path_1 = __webpack_require__(85622);
172878
172890
  const util_1 = __webpack_require__(31669);
172891
+ const common_1 = __webpack_require__(51469);
172879
172892
  const debug_1 = __webpack_require__(36583);
172880
172893
  const readdir = util_1.promisify(fs.readdir);
172881
- const stat = util_1.promisify(fs.stat);
172894
+ exports.stat = util_1.promisify(fs.stat);
172882
172895
  async function find(dir) {
172883
- const result = [];
172884
- const dirStat = await stat(dir);
172896
+ const dirStat = await exports.stat(dir);
172885
172897
  if (!dirStat.isDirectory()) {
172886
172898
  throw new Error(`${dir} is not a directory`);
172887
172899
  }
172888
172900
  const paths = await readdir(dir);
172901
+ const absolutePaths = [];
172889
172902
  for (const relativePath of paths) {
172890
- const absolutePath = path_1.join(dir, relativePath);
172903
+ absolutePaths.push(path_1.join(dir, relativePath));
172904
+ }
172905
+ return await extractFilePaths(absolutePaths);
172906
+ }
172907
+ exports.find = find;
172908
+ async function extractFilePaths(absolutePaths) {
172909
+ const result = [];
172910
+ for (const absolutePath of absolutePaths) {
172891
172911
  try {
172892
- const fileStat = await stat(absolutePath);
172893
- if (fileStat.isDirectory()) {
172912
+ const fileStats = await exports.stat(absolutePath);
172913
+ if (fileStats.isDirectory()) {
172894
172914
  const subFiles = await find(absolutePath);
172895
- for (const file of subFiles) {
172896
- result.push(file);
172897
- }
172915
+ result.push(...subFiles);
172898
172916
  }
172899
- if (fileStat.isFile()) {
172917
+ else if (fileStats.isFile()) {
172918
+ if (fileStats.size > common_1.MAX_SUPPORTED_FILE_SIZE) {
172919
+ continue;
172920
+ }
172900
172921
  result.push(absolutePath);
172901
172922
  }
172902
172923
  }
172903
172924
  catch (error) {
172904
- debug_1.debug(error.message || `Error reading file ${relativePath}. ${error}`);
172925
+ debug_1.debug(error.message || `Error reading file ${absolutePath}. ${error}`);
172905
172926
  }
172906
172927
  }
172907
172928
  return result;
172908
172929
  }
172909
- exports.find = find;
172930
+ exports.extractFilePaths = extractFilePaths;
172910
172931
  //# sourceMappingURL=find.js.map
172911
172932
 
172912
172933
  /***/ }),