Skip to content

Commit

Permalink
feat: remove @* logic so we hit the fast path
Browse files Browse the repository at this point in the history
This @* logic is not helpful here, because snyk-module already
returns '*' for unrecognised versions.

It is incorrect, because we don't append the start for scoped
packages, as we are incorrectly checking for an @. i.e.
@snyk/foo matches, and it shouldn't.

It also stops us hitting the new fast-path in snyk-module.
  • Loading branch information
FauxFaux committed Nov 29, 2019
1 parent f1bd932 commit b5c1020
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions lib/match.js
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

0 comments on commit b5c1020

Please sign in to comment.