snyk 1.1009.0 → 1.1011.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.
package/dist/cli/522.index.js
CHANGED
|
@@ -154834,12 +154834,10 @@ exports.spawn = spawn;
|
|
|
154834
154834
|
"use strict";
|
|
154835
154835
|
|
|
154836
154836
|
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
154837
|
-
exports.isSupportedSize = exports.DECOMPRESSING_IGNORE_DIR = exports.DECOMPRESSING_WORKSPACE_DIR = exports.DECOMPRESSING_CONCURRENCY_LEVEL = exports.HASHING_CONCURRENCY_LEVEL = exports.MAX_SUPPORTED_FILE_SIZE = exports.
|
|
154837
|
+
exports.isSupportedSize = exports.DECOMPRESSING_IGNORE_DIR = exports.DECOMPRESSING_WORKSPACE_DIR = exports.DECOMPRESSING_CONCURRENCY_LEVEL = exports.HASHING_CONCURRENCY_LEVEL = exports.MAX_SUPPORTED_FILE_SIZE = exports.isWin = void 0;
|
|
154838
154838
|
const os = __webpack_require__(12087);
|
|
154839
|
-
const
|
|
154840
|
-
exports.
|
|
154841
|
-
.toLowerCase()
|
|
154842
|
-
.indexOf('windows') === 0;
|
|
154839
|
+
const process_1 = __webpack_require__(61765);
|
|
154840
|
+
exports.isWin = process_1.platform === 'win32';
|
|
154843
154841
|
exports.MAX_SUPPORTED_FILE_SIZE = 2 * 1024 * 1024 * 1024 - 1;
|
|
154844
154842
|
exports.HASHING_CONCURRENCY_LEVEL = os.cpus().length;
|
|
154845
154843
|
exports.DECOMPRESSING_CONCURRENCY_LEVEL = os.cpus().length * 8;
|
|
@@ -155181,7 +155179,6 @@ async function find(src, excludePatterns = []) {
|
|
|
155181
155179
|
fileResults.push(path);
|
|
155182
155180
|
};
|
|
155183
155181
|
const isExcluded = (path) => {
|
|
155184
|
-
path = common_1.isWindowsOS() ? path.split(path_1.sep).join(path_1.posix.sep) : path;
|
|
155185
155182
|
return !!excludePatterns.find((pattern) => minimatch(path, pattern));
|
|
155186
155183
|
};
|
|
155187
155184
|
await traverse(src, handler, isExcluded);
|
|
@@ -155364,6 +155361,11 @@ async function scan(options) {
|
|
|
155364
155361
|
const start = Date.now();
|
|
155365
155362
|
const projectRoot = options.path;
|
|
155366
155363
|
const excludedPatterns = getExcludedPatterns(projectRoot, options['policy-path']);
|
|
155364
|
+
if (common_1.isWin) {
|
|
155365
|
+
excludedPatterns.forEach((path, index) => {
|
|
155366
|
+
excludedPatterns[index] = path.split(path_1.posix.sep).join(path_1.sep);
|
|
155367
|
+
});
|
|
155368
|
+
}
|
|
155367
155369
|
const [filePaths, archivePaths] = await find_1.find(projectRoot, excludedPatterns);
|
|
155368
155370
|
if (!filePaths.length) {
|
|
155369
155371
|
throw 'There were no files in the target directory that could be scanned. Check if the directory is empty or if an ignore policy is active.';
|
|
@@ -155463,13 +155465,18 @@ exports.computeSignaturesConcurrently = void 0;
|
|
|
155463
155465
|
const fs_1 = __webpack_require__(35747);
|
|
155464
155466
|
const hash_1 = __webpack_require__(42099);
|
|
155465
155467
|
const common_1 = __webpack_require__(51469);
|
|
155468
|
+
const debug_1 = __webpack_require__(36583);
|
|
155466
155469
|
const pMap = __webpack_require__(81334);
|
|
155467
155470
|
const { readFile } = fs_1.promises;
|
|
155468
155471
|
async function computeSignaturesConcurrently(paths) {
|
|
155469
|
-
|
|
155472
|
+
const start = Date.now();
|
|
155473
|
+
const result = pMap(paths, async (path) => {
|
|
155470
155474
|
const content = await readFile(path);
|
|
155471
155475
|
return await hash_1.computeHash(path, content);
|
|
155472
155476
|
}, { concurrency: common_1.HASHING_CONCURRENCY_LEVEL });
|
|
155477
|
+
const totalMilliseconds = Date.now() - start;
|
|
155478
|
+
debug_1.debug(`elapsed time in pMap: ${totalMilliseconds} ms \n`);
|
|
155479
|
+
return result;
|
|
155473
155480
|
}
|
|
155474
155481
|
exports.computeSignaturesConcurrently = computeSignaturesConcurrently;
|
|
155475
155482
|
//# sourceMappingURL=signatures.js.map
|