retire 3.1.3 → 3.2.1

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,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## [3.2.0]
4
+
5
+ - Remove unintended use of arrow functions
6
+
7
+ ## [3.2.0]
8
+
9
+ - Add `--ext` to allow specifying other file extensions
10
+
3
11
  ## [3.1.3]
4
12
 
5
13
  - Fixes a typo
package/README.md CHANGED
@@ -39,6 +39,7 @@ Options:
39
39
  --exitwith <code> Custom exit code (default: 13) when vulnerabilities are found
40
40
  --colors Enable color output (console output only)
41
41
  --insecure Enable fetching remote jsrepo/noderepo files from hosts using an insecure or self-signed SSL (TLS) certificate
42
+ --ext <extensions> Comman separated list of file extensions for javascript files. The default is "js"
42
43
  --cacert <path> Use the specified certificate file to verify the peer used for fetching remote jsrepo/noderepo files
43
44
  ````
44
45
 
package/bin/retire CHANGED
@@ -60,13 +60,14 @@ program
60
60
  .option('--exitwith <code>', 'Custom exit code (default: 13) when vulnerabilities are found')
61
61
  .option('--colors', 'Enable color output (console output only)')
62
62
  .option('--insecure', 'Enable fetching remote jsrepo/noderepo files from hosts using an insecure or self-signed SSL (TLS) certificate')
63
+ .option('--ext <extensions>', 'Comman separated list of file extensions for javascript files. The default is "js"')
63
64
  .option('--cacert <path>', 'Use the specified certificate file to verify the peer used for fetching remote jsrepo/noderepo files')
64
65
  .parse(process.argv);
65
66
 
66
67
  var config = utils.extend({ path: '.' }, utils.pick(program, [
67
68
  'package', 'node', 'js', 'jspath', 'verbose', 'nodepath', 'path', 'jsrepo', 'noderepo',
68
69
  'dropexternal', 'nocache', 'proxy', 'ignore', 'ignorefile', 'outputformat', 'outputpath',
69
- 'severity', 'exitwith', 'colors', 'includemeta', 'cachedir', 'insecure', 'cacert'
70
+ 'severity', 'exitwith', 'colors', 'includemeta', 'cachedir', 'insecure', 'cacert', 'ext'
70
71
  ]));
71
72
 
72
73
  if (!config.nocache && !config.cachedir) {
package/lib/resolve.js CHANGED
@@ -69,8 +69,9 @@ function getNodeDependencies(path, limit) {
69
69
 
70
70
  function scanJsFiles(path, options) {
71
71
  var finder = walkdir.find(path, { "follow_symlinks" : false, "no_return": true });
72
+ var ext = (options.ext || "js").split(",").map(function(e) { return "." + e; });
72
73
  function onFile(file){
73
- if (file.match(/\.js$/)) {
74
+ if (ext.some(function(e) { return file.endsWith(e); })) {
74
75
  finder.emit('jsfile', file);
75
76
  }
76
77
  if (file.match(/\/bower.json$/)) {
package/lib/retire.js CHANGED
@@ -4,7 +4,7 @@
4
4
  */
5
5
 
6
6
  var exports = exports || {};
7
- exports.version = '3.1.3';
7
+ exports.version = '3.2.1';
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": "3.1.3",
5
+ "version": "3.2.1",
6
6
  "license": "Apache-2.0",
7
7
  "repository": {
8
8
  "type": "git",