Skip to content

Commit

Permalink
Merge pull request #34 from snyk/feat/upgrade-module
Browse files Browse the repository at this point in the history
feat: upgrade snyk-module
  • Loading branch information
FauxFaux committed Nov 29, 2019
2 parents 6f3b8ff + b5c1020 commit d261c06
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 9 deletions.
1 change: 1 addition & 0 deletions .npmrc
@@ -0,0 +1 @@
package-lock=false
2 changes: 1 addition & 1 deletion lib/filter/get-vuln-source.js
Expand Up @@ -6,7 +6,7 @@ var debug = require('debug')('snyk:policy');
var resolve = require('snyk-resolve');
var path = require('path');
var statSync = require('fs').statSync;
var moduleToObject = require('snyk-module');
var { parsePackageString: moduleToObject } = require('snyk-module');

function getVulnSource(vuln, cwd, live) {
var from = vuln.from.slice(1).map(function (pkg) {
Expand Down
8 changes: 1 addition & 7 deletions lib/match.js
Expand Up @@ -6,7 +6,7 @@ module.exports = {
var debug = require('debug')('snyk:policy');
var debugPolicy = require('debug')('snyk:protect');
var semver = require('semver');
var moduleToObject = require('snyk-module');
var { parsePackageString: moduleToObject } = require('snyk-module');

// matchPath will take the array of dependencies that a vulnerability came from
// and try to match it to a string `path`. The path will look like this:
Expand Down Expand Up @@ -70,12 +70,6 @@ function matchPath(from, path) {
return true;
}

// if we're missing the @version - add @* so the pkg is foobar@*
// so we have a good semver range
if (pkg.indexOf('@') === -1) {
pkg += '@*';
}

var target = moduleToObject(pkg);

var pkgVersion = target.version;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -27,7 +27,7 @@
"js-yaml": "^3.13.1",
"lodash.clonedeep": "^4.5.0",
"semver": "^6.0.0",
"snyk-module": "^1.9.1",
"snyk-module": "^2.0.2",
"snyk-resolve": "^1.0.1",
"snyk-try-require": "^1.3.1",
"then-fs": "^2.0.0"
Expand Down

0 comments on commit d261c06

Please sign in to comment.