snyk-module
Advanced tools
Comparing version 2.0.2 to 2.1.0
@@ -23,2 +23,11 @@ "use strict"; | ||
let str = nameAndMaybeVersion; | ||
// first, try the common case; there's no version, and it's a normal package name | ||
if (!version) { | ||
// foo, foo-bar, @foo/bar, com.example:test | ||
// none of these can be URLs, or versions | ||
const fastPath = /^(?:(?:[a-z-]+)|(?:@[a-z-]+\/[a-z-]+)|(?:[a-z-]+\.[.a-z-]+:[a-z-]+))$/; | ||
if (fastPath.test(str)) { | ||
return supported(str, { name: str, version: '*' }, options); | ||
} | ||
} | ||
if (version && str.lastIndexOf('@') < 1) { | ||
@@ -25,0 +34,0 @@ debug('appending version onto string'); |
@@ -39,2 +39,12 @@ const debug = require('debug')('snyk:module'); | ||
// first, try the common case; there's no version, and it's a normal package name | ||
if (!version) { | ||
// foo, foo-bar, @foo/bar, com.example:test | ||
// none of these can be URLs, or versions | ||
const fastPath = /^(?:(?:[a-z-]+)|(?:@[a-z-]+\/[a-z-]+)|(?:[a-z-]+\.[.a-z-]+:[a-z-]+))$/; | ||
if (fastPath.test(str)) { | ||
return supported(str, { name: str, version: '*' }, options); | ||
} | ||
} | ||
if (version && str.lastIndexOf('@') < 1) { | ||
@@ -41,0 +51,0 @@ debug('appending version onto string'); |
@@ -26,2 +26,3 @@ { | ||
"@typescript-eslint/parser": "^1.13.0", | ||
"benny": "^3.6.14", | ||
"eslint": "^5.16.0", | ||
@@ -40,3 +41,3 @@ "eslint-config-prettier": "^6.0.0", | ||
}, | ||
"version": "2.0.2" | ||
"version": "2.1.0" | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
24131
14
558
9