validate-npm-package-name
Advanced tools
Comparing version 1.1.1 to 1.2.0
12
index.js
@@ -1,2 +0,6 @@ | ||
var scopedPackagePattern = new RegExp("^(?:@([^/]+?)[/])?([^/]+?)$") | ||
var scopedPackagePattern = new RegExp("^(?:@([^/]+?)[/])?([^/]+?)$"); | ||
var blacklist = [ | ||
"node_modules", | ||
"favicon.ico" | ||
]; | ||
@@ -52,2 +56,8 @@ var validate = module.exports = function(name, options) { | ||
blacklist.forEach(function(blacklistedName){ | ||
if (name.toLowerCase() === blacklistedName) { | ||
errors.push(blacklistedName + " is a blacklisted name") | ||
} | ||
}) | ||
if (encodeURIComponent(name) !== name) { | ||
@@ -54,0 +64,0 @@ |
{ | ||
"name": "validate-npm-package-name", | ||
"version": "1.1.1", | ||
"version": "1.2.0", | ||
"description": "Give me a string and I'll tell you if it's a valid npm package name", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -52,2 +52,10 @@ var valid = require("..") | ||
t.deepEqual(valid("node_modules"), { | ||
valid: false, | ||
errors: ["node_modules is a blacklisted name"]}) | ||
t.deepEqual(valid("favicon.ico"), { | ||
valid: false, | ||
errors: ["favicon.ico is a blacklisted name"]}) | ||
// Legacy Mixed-Case | ||
@@ -54,0 +62,0 @@ |
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
7244
138