@contrast/contrast 3.2.3 → 3.2.4

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.
@@ -6,7 +6,10 @@ function resolveFilePath(filepath) {
6
6
  return filepath;
7
7
  }
8
8
  const returnProjectPath = () => {
9
- if (process.env.PWD !== (undefined || null || 'undefined')) {
9
+ if (process.env.PWD &&
10
+ process.env.PWD !== 'undefined' &&
11
+ process.env.PWD !== undefined &&
12
+ process.env.PWD !== null) {
10
13
  return process.env.PWD;
11
14
  }
12
15
  else {
@@ -17,7 +17,7 @@ export const HIGH = 'HIGH';
17
17
  export const CRITICAL = 'CRITICAL';
18
18
  // App
19
19
  export const APP_NAME = 'contrast';
20
- const APP_VERSION = '3.2.3';
20
+ const APP_VERSION = '3.2.4';
21
21
  export const TIMEOUT = 120000;
22
22
  export const CRITICAL_PRIORITY = 1;
23
23
  export const HIGH_PRIORITY = 2;
@@ -32,7 +32,7 @@ export const readYarn = async (config, languageFiles, nameOfFile) => {
32
32
  throw new Error(i18n.__('nodeReadYarnLockFileError') + `${err.message}`);
33
33
  }
34
34
  };
35
- export const parseNpmLockFile = async (npmLockFile, lockFileVersion) => {
35
+ export const parseNpmLockFile = async (npmLockFile, lockFileVersion, config) => {
36
36
  try {
37
37
  if (!npmLockFile.parsedPackages) {
38
38
  npmLockFile.parsedPackages = {};
@@ -47,6 +47,9 @@ export const parseNpmLockFile = async (npmLockFile, lockFileVersion) => {
47
47
  delete packageValue.license;
48
48
  }
49
49
  npmLockFile.parsedPackages[packageKey] = packageValue;
50
+ if (config?.ignoreDev && packageValue.dev) {
51
+ delete npmLockFile.parsedPackages[packageKey];
52
+ }
50
53
  });
51
54
  if (lockFileVersion === 3) {
52
55
  buildDependencyTreeForV3LockFile(npmLockFile);
@@ -47,7 +47,7 @@ const parseFiles = async (config, files, js) => {
47
47
  logDebug(config, message);
48
48
  throw new Error(message);
49
49
  }
50
- js.npmLockFile = await parseNpmLockFile(npmLockFile, currentLockFileVersion);
50
+ js.npmLockFile = await parseNpmLockFile(npmLockFile, currentLockFileVersion, config);
51
51
  }
52
52
  if (files.includes('yarn.lock')) {
53
53
  js = await parseYarnLockFile(js);
@@ -11,7 +11,10 @@ const returnProjectPath = () => {
11
11
  let winPath = child_process.execSync('cd').toString();
12
12
  return winPath.replace(/\//g, '\\').trim();
13
13
  }
14
- else if (process.env.PWD !== (undefined || null || 'undefined')) {
14
+ else if (process.env.PWD &&
15
+ process.env.PWD !== undefined &&
16
+ process.env.PWD !== null &&
17
+ process.env.PWD !== 'undefined') {
15
18
  return process.env.PWD;
16
19
  }
17
20
  else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contrast/contrast",
3
- "version": "3.2.3",
3
+ "version": "3.2.4",
4
4
  "description": "Contrast Security's command line tool",
5
5
  "exports": "./dist/index.js",
6
6
  "type": "module",