snyk 1.1149.0 → 1.1151.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.
@@ -6773,9 +6773,7 @@ async function getFilters(baseURL, source, attempts = constants_1.MAX_RETRY_ATTE
6773
6773
  exports.getFilters = getFilters;
6774
6774
  function commonHttpHeaders(options) {
6775
6775
  return {
6776
- 'Session-Token': options.sessionToken,
6777
- // We need to be able to test code-client without deepcode locally
6778
- Authorization: `Bearer ${options.sessionToken}`,
6776
+ Authorization: options.sessionToken,
6779
6777
  source: options.source,
6780
6778
  ...(options.requestId && { 'snyk-request-id': options.requestId }),
6781
6779
  ...(options.org && { 'snyk-org-name': options.org }),
@@ -153552,7 +153550,7 @@ async function scan(options) {
153552
153550
  });
153553
153551
  }
153554
153552
  const [filePaths, archivePaths] = await find_1.find(projectRoot, excludedPatterns);
153555
- if (!filePaths.length) {
153553
+ if (filePaths.length + archivePaths.length == 0) {
153556
153554
  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.';
153557
153555
  }
153558
153556
  let extractionWorkspace = undefined;
@@ -169087,6 +169085,8 @@ async function buildGraph(snykGraph, projectName, projectVersion, coordinateMap)
169087
169085
  if (!item)
169088
169086
  continue;
169089
169087
  let { id, parentId } = item;
169088
+ // take a copy as id maybe mutated below and we need this id when finding childing in snykGraph
169089
+ const snykGraphId = `${id}`;
169090
169090
  const node = snykGraph[id];
169091
169091
  if (!node)
169092
169092
  continue;
@@ -169112,7 +169112,7 @@ async function buildGraph(snykGraph, projectName, projectVersion, coordinateMap)
169112
169112
  }
169113
169113
  depGraphBuilder.addPkgNode({ name, version }, id);
169114
169114
  depGraphBuilder.connectDep(parentId, id);
169115
- queue.push(...findChildren(id, snykGraph)); // queue children
169115
+ queue.push(...findChildren(snykGraphId, snykGraph)); // queue children
169116
169116
  visited.push(id);
169117
169117
  }
169118
169118
  return depGraphBuilder.build();