snyk 1.786.0 → 1.790.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.
@@ -18788,13 +18788,14 @@ const sub_process_1 = __webpack_require__(28219);
18788
18788
  const path = __webpack_require__(85622);
18789
18789
  const os_1 = __webpack_require__(12087);
18790
18790
  const errors_1 = __webpack_require__(38133);
18791
+ const fs = __webpack_require__(35747);
18792
+ const tmp = __webpack_require__(21086);
18791
18793
  function getGradleCommandArgs(targetPath, initScript, confAttrs) {
18792
- const gradleArgs = [
18793
- 'printClasspath',
18794
- '-I',
18795
- path.join(__dirname, ...'../bin/init.gradle'.split('/')),
18796
- '-q',
18797
- ];
18794
+ // For binary releases, the original file would be in the binary build and inaccesible
18795
+ const originalPath = path.join(__dirname, ...'../bin/init.gradle'.split('/'));
18796
+ const tmpFilePath = tmp.fileSync().name;
18797
+ fs.copyFileSync(originalPath, tmpFilePath);
18798
+ const gradleArgs = ['printClasspath', '-I', tmpFilePath, '-q'];
18798
18799
  if (targetPath) {
18799
18800
  gradleArgs.push('-p', targetPath);
18800
18801
  }
@@ -172542,6 +172543,7 @@ function selectDisplayStrategy(options, depGraph, testResult) {
172542
172543
  }
172543
172544
  exports.selectDisplayStrategy = selectDisplayStrategy;
172544
172545
  function displayDependencies(depGraph, fileSignaturesDetails, depsFilePaths = {}) {
172546
+ var _a;
172545
172547
  let result = [];
172546
172548
  const dependencies = depGraph === null || depGraph === void 0 ? void 0 : depGraph.getDepPkgs();
172547
172549
  const hasDependencies = (dependencies === null || dependencies === void 0 ? void 0 : dependencies.length) > 0;
@@ -172550,10 +172552,9 @@ function displayDependencies(depGraph, fileSignaturesDetails, depsFilePaths = {}
172550
172552
  }
172551
172553
  result.push(chalk.whiteBright('\nDependencies:\n'));
172552
172554
  for (const { name, version } of dependencies) {
172553
- const dependencyId = `${name}@${version}`;
172555
+ const dependencyId = `${name}@${version}`.toLowerCase();
172554
172556
  result.push(`\n${common_1.leftPad(dependencyId, 2)}`);
172555
- if (fileSignaturesDetails &&
172556
- fileSignaturesDetails[dependencyId].confidence) {
172557
+ if (fileSignaturesDetails && ((_a = fileSignaturesDetails[dependencyId]) === null || _a === void 0 ? void 0 : _a.confidence)) {
172557
172558
  result.push(common_1.leftPad(`confidence: ${fileSignaturesDetails[dependencyId].confidence.toFixed(3)}`, 2));
172558
172559
  }
172559
172560
  if (!object_1.isEmpty(depsFilePaths)) {
@@ -172681,7 +172682,7 @@ exports.display = display;
172681
172682
  "use strict";
172682
172683
 
172683
172684
  Object.defineProperty(exports, "__esModule", ({ value: true }));
172684
- exports.extractFilePaths = exports.find = exports.stat = void 0;
172685
+ exports.find = exports.stat = void 0;
172685
172686
  const fs = __webpack_require__(35747);
172686
172687
  const path_1 = __webpack_require__(85622);
172687
172688
  const util_1 = __webpack_require__(31669);
@@ -172689,42 +172690,34 @@ const common_1 = __webpack_require__(51469);
172689
172690
  const debug_1 = __webpack_require__(36583);
172690
172691
  const readdir = util_1.promisify(fs.readdir);
172691
172692
  exports.stat = util_1.promisify(fs.stat);
172692
- async function find(dir) {
172693
- const dirStat = await exports.stat(dir);
172694
- if (!dirStat.isDirectory()) {
172695
- throw new Error(`${dir} is not a directory`);
172696
- }
172697
- const paths = await readdir(dir);
172698
- const absolutePaths = [];
172699
- for (const relativePath of paths) {
172700
- absolutePaths.push(path_1.join(dir, relativePath));
172701
- }
172702
- return await extractFilePaths(absolutePaths);
172693
+ async function find(src) {
172694
+ const result = [];
172695
+ await traverse(src, (filePath, stats) => {
172696
+ if (!stats.isFile() || stats.size > common_1.MAX_SUPPORTED_FILE_SIZE) {
172697
+ return;
172698
+ }
172699
+ result.push(filePath);
172700
+ });
172701
+ return result;
172703
172702
  }
172704
172703
  exports.find = find;
172705
- async function extractFilePaths(absolutePaths) {
172706
- const result = [];
172707
- for (const absolutePath of absolutePaths) {
172708
- try {
172709
- const fileStats = await exports.stat(absolutePath);
172710
- if (fileStats.isDirectory()) {
172711
- const subFiles = await find(absolutePath);
172712
- result.push(...subFiles);
172713
- }
172714
- else if (fileStats.isFile()) {
172715
- if (fileStats.size > common_1.MAX_SUPPORTED_FILE_SIZE) {
172716
- continue;
172717
- }
172718
- result.push(absolutePath);
172719
- }
172704
+ async function traverse(src, handle) {
172705
+ try {
172706
+ const stats = await exports.stat(src);
172707
+ if (!stats.isDirectory()) {
172708
+ handle(src, stats);
172709
+ return;
172720
172710
  }
172721
- catch (error) {
172722
- debug_1.debug(error.message || `Error reading file ${absolutePath}. ${error}`);
172711
+ const entries = await readdir(src);
172712
+ for (const entry of entries) {
172713
+ const absolute = path_1.join(src, entry);
172714
+ await traverse(absolute, handle);
172723
172715
  }
172724
172716
  }
172725
- return result;
172717
+ catch (error) {
172718
+ debug_1.debug(error.message || `Error reading file ${src}. ${error}`);
172719
+ }
172726
172720
  }
172727
- exports.extractFilePaths = extractFilePaths;
172728
172721
  //# sourceMappingURL=find.js.map
172729
172722
 
172730
172723
  /***/ }),
@@ -207178,14 +207171,14 @@ async function getTargetFrameworksFromProjFile(rootDir) {
207178
207171
  reject(new errors_1.FileNotProcessableError(err));
207179
207172
  return;
207180
207173
  }
207181
- const parsedTargetFrameworks = (((_b = (_a = parsedCsprojContents === null || parsedCsprojContents === void 0 ? void 0 : parsedCsprojContents.Project) === null || _a === void 0 ? void 0 : _a.PropertyGroup) === null || _b === void 0 ? void 0 : _b.reduce((targetFrameworks, propertyGroup) => {
207174
+ const parsedTargetFrameworks = ((_b = (_a = parsedCsprojContents === null || parsedCsprojContents === void 0 ? void 0 : parsedCsprojContents.Project) === null || _a === void 0 ? void 0 : _a.PropertyGroup) === null || _b === void 0 ? void 0 : _b.reduce((targetFrameworks, propertyGroup) => {
207182
207175
  var _a, _b, _c;
207183
207176
  const targetFrameworkSource = ((_a = propertyGroup === null || propertyGroup === void 0 ? void 0 : propertyGroup.TargetFrameworkVersion) === null || _a === void 0 ? void 0 : _a[0]) || ((_b = propertyGroup === null || propertyGroup === void 0 ? void 0 : propertyGroup.TargetFramework) === null || _b === void 0 ? void 0 : _b[0]) || ((_c = propertyGroup === null || propertyGroup === void 0 ? void 0 : propertyGroup.TargetFrameworks) === null || _c === void 0 ? void 0 : _c[0]) ||
207184
207177
  '';
207185
207178
  return targetFrameworks
207186
207179
  .concat(targetFrameworkSource.split(';'))
207187
207180
  .filter(Boolean);
207188
- }, [])) || []);
207181
+ }, [])) || [];
207189
207182
  if (parsedTargetFrameworks.length < 1) {
207190
207183
  debug('Could not find TargetFrameworkVersion/TargetFramework' +
207191
207184
  '/TargetFrameworks defined in the Project.PropertyGroup field of ' +
@@ -207834,7 +207827,7 @@ async function loadNuspecFromAsync(dep) {
207834
207827
  //this is exported for testing, but should not executed directly. Hence the '_' in the name.
207835
207828
  async function _parsedNuspec(nuspecContent, targetFramework, depName) {
207836
207829
  var _a;
207837
- const parsedNuspec = await parseXML.parseStringPromise(nuspecContent);
207830
+ const parsedNuspec = await parseXML.parseStringPromise(nuspecContent.trim());
207838
207831
  let ownDeps = [];
207839
207832
  //note: this will throw if assertion fails
207840
207833
  assertNuspecSchema(parsedNuspec);