retire 4.3.3 → 4.3.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.
package/CHANGELOG.md CHANGED
@@ -1,6 +1,12 @@
1
1
  # Changelog
2
2
 
3
- ## [4.3.2]
3
+ ## [4.3.4]
4
+
5
+ ### Bugfix
6
+
7
+ - Bug: `--jspath` is not being honoured
8
+
9
+ ## [4.3.3]
4
10
 
5
11
  ### Bugfix
6
12
 
package/lib/cli.js CHANGED
@@ -26,7 +26,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
26
26
  var __importDefault = (this && this.__importDefault) || function (mod) {
27
27
  return (mod && mod.__esModule) ? mod : { "default": mod };
28
28
  };
29
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
29
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
30
30
  Object.defineProperty(exports, "__esModule", { value: true });
31
31
  const utils = __importStar(require("./utils"));
32
32
  const commander_1 = require("commander");
@@ -56,8 +56,8 @@ const prg = commander_1.program
56
56
  .version(retire.version)
57
57
  .option('-v, --verbose', 'Show identified files (by default only vulnerable files are shown)')
58
58
  .option('-c, --nocache', "Don't use local cache")
59
- .option('--jspath <path>', 'Folder to scan for javascript files')
60
- .option('--path <path>', 'Folder to scan for both')
59
+ .option('--jspath <path>', 'Folder to scan for javascript files (deprecated)')
60
+ .option('--path <path>', 'Folder to scan for javascript files')
61
61
  .option('--jsrepo <path|url>', "Local or internal version of repo. Can be multiple comma separated. Default: 'central')")
62
62
  .option('--cachedir <path>', 'Path to use for local cache instead of /tmp/.retire-cache')
63
63
  .option('--proxy <url>', 'Proxy url (http://some.host:8080)')
@@ -79,7 +79,7 @@ const jsrepolocation = ((_a = prg.jsrepo) !== null && _a !== void 0 ? _a : "'cen
79
79
  .split(',')
80
80
  .map((x) => x === "'central'" ? 'https://raw.githubusercontent.com/RetireJS/retire.js/master/repository/jsrepository.json' : x);
81
81
  const ignorefile = (_b = prg.ignoreFile) !== null && _b !== void 0 ? _b : defaultIgnoreFiles.filter((x) => fs_1.default.existsSync(x))[0];
82
- const scanpath = (_c = prg.path) !== null && _c !== void 0 ? _c : '.';
82
+ const scanpath = (_d = (_c = prg.path) !== null && _c !== void 0 ? _c : prg.jspath) !== null && _d !== void 0 ? _d : '.';
83
83
  const log = reporting.open({
84
84
  colors: !!prg.colors,
85
85
  colorwarn,
@@ -89,7 +89,7 @@ const log = reporting.open({
89
89
  path: scanpath,
90
90
  verbose: !!prg.verbose,
91
91
  });
92
- const severity = (_d = prg.severity) !== null && _d !== void 0 ? _d : 'none';
92
+ const severity = (_e = prg.severity) !== null && _e !== void 0 ? _e : 'none';
93
93
  if (!(severity in types_1.severityLevels)) {
94
94
  exitWithError(`Error: Invalid severity level (${severity}). Valid levels are: ${Object.keys(types_1.severityLevels).join(', ')}`);
95
95
  }
@@ -97,15 +97,15 @@ const config = {
97
97
  path: scanpath,
98
98
  ignore: {
99
99
  paths: [],
100
- pathsAsString: (_g = (_f = (_e = prg.ignore) === null || _e === void 0 ? void 0 : _e.split(',')) === null || _f === void 0 ? void 0 : _f.map((x) => path_1.default.resolve(x))) !== null && _g !== void 0 ? _g : [],
100
+ pathsAsString: (_h = (_g = (_f = prg.ignore) === null || _f === void 0 ? void 0 : _f.split(',')) === null || _g === void 0 ? void 0 : _g.map((x) => path_1.default.resolve(x))) !== null && _h !== void 0 ? _h : [],
101
101
  descriptors: [],
102
102
  },
103
103
  colorwarn,
104
104
  nocache: prg.nocache ? true : false,
105
- cachedir: (_h = prg.cachedir) !== null && _h !== void 0 ? _h : path_1.default.resolve(os_1.default.tmpdir(), '.retire-cache/'),
105
+ cachedir: (_j = prg.cachedir) !== null && _j !== void 0 ? _j : path_1.default.resolve(os_1.default.tmpdir(), '.retire-cache/'),
106
106
  log: log,
107
107
  severity: severity,
108
- exitwith: (_j = prg.exitwith) !== null && _j !== void 0 ? _j : 13,
108
+ exitwith: (_k = prg.exitwith) !== null && _k !== void 0 ? _k : 13,
109
109
  includeOsv: !!prg.includeOsv,
110
110
  verbose: !!prg.verbose,
111
111
  proxy: prg.proxy,
@@ -146,7 +146,7 @@ if (ignorefile) {
146
146
  catch (e) {
147
147
  exitWithError(`Error: Invalid ignore file: ${ignorefile}`);
148
148
  }
149
- const ignoredPaths = (_m = (_l = (_k = config.ignore.descriptors) === null || _k === void 0 ? void 0 : _k.map((x) => ('path' in x ? x.path : undefined))) === null || _l === void 0 ? void 0 : _l.filter((x) => x != undefined)) !== null && _m !== void 0 ? _m : [];
149
+ const ignoredPaths = (_o = (_m = (_l = config.ignore.descriptors) === null || _l === void 0 ? void 0 : _l.map((x) => ('path' in x ? x.path : undefined))) === null || _m === void 0 ? void 0 : _m.filter((x) => x != undefined)) !== null && _o !== void 0 ? _o : [];
150
150
  config.ignore.pathsAsString = config.ignore.pathsAsString.concat(ignoredPaths);
151
151
  }
152
152
  else {
package/lib/retire.js CHANGED
@@ -4,7 +4,7 @@
4
4
  */
5
5
 
6
6
  var exports = exports || {};
7
- exports.version = '4.3.3';
7
+ exports.version = '4.3.4';
8
8
 
9
9
  function isDefined(o) {
10
10
  return typeof o !== 'undefined';
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "author": "Erlend Oftedal <erlend@oftedal.no>",
3
3
  "name": "retire",
4
4
  "description": "Retire is a tool for detecting use of vulnerable libraries",
5
- "version": "4.3.3",
5
+ "version": "4.3.4",
6
6
  "license": "Apache-2.0",
7
7
  "repository": {
8
8
  "type": "git",