retire 4.3.2 → 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 +12 -0
- package/lib/cli.js +10 -10
- package/lib/retire.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
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
|
|
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,23 +89,23 @@ const log = reporting.open({
|
|
|
89
89
|
path: scanpath,
|
|
90
90
|
verbose: !!prg.verbose,
|
|
91
91
|
});
|
|
92
|
-
const severity = (
|
|
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
|
}
|
|
96
96
|
const config = {
|
|
97
97
|
path: scanpath,
|
|
98
98
|
ignore: {
|
|
99
|
-
paths:
|
|
100
|
-
pathsAsString: [],
|
|
99
|
+
paths: [],
|
|
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: (
|
|
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: (
|
|
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 = (
|
|
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
package/package.json
CHANGED