normalize-package-data
Advanced tools
Comparing version 0.2.4 to 0.2.5
@@ -7,2 +7,3 @@ var semver = require("semver") | ||
var typos = require("./typos") | ||
var coreModuleNames = require("./core_module_names") | ||
@@ -201,2 +202,4 @@ var fixer = module.exports = { | ||
ensureValidName(data.name, strict) | ||
if (coreModuleNames.indexOf(data.name) !== -1) | ||
this.warn(data.name + " is also the name of a node core module.") | ||
} | ||
@@ -266,3 +269,3 @@ | ||
, fixHomepageField: function(data) { | ||
, fixHomepageField: function(data) { | ||
if (!data.homepage && data.repository && data.repository.url) { | ||
@@ -269,0 +272,0 @@ var gh = parseGitHubURL(data.repository.url) |
{ | ||
"name": "normalize-package-data", | ||
"version": "0.2.4", | ||
"version": "0.2.5", | ||
"author": "Meryn Stol <merynstol@gmail.com>", | ||
@@ -5,0 +5,0 @@ "description": "Normalizes data that can be found in package.json files.", |
@@ -58,2 +58,26 @@ var tap = require("tap") | ||
tap.test("core module name", function(t) { | ||
var warnings = [] | ||
function warn(m) { | ||
warnings.push(m) | ||
} | ||
var a | ||
normalize(a={ | ||
name: "http", | ||
readme: "read yourself how about", | ||
homepage: 123, | ||
bugs: "what is this i don't even", | ||
repository: "Hello." | ||
}, warn) | ||
var expect = [ | ||
"http is also the name of a node core module.", | ||
"Bug string field must be url, email, or {email,url}", | ||
"Normalized value of bugs field is an empty object. Deleted.", | ||
"homepage field must be a string url. Deleted." | ||
] | ||
t.same(warnings, expect) | ||
t.end() | ||
}) | ||
tap.test("urls required", function(t) { | ||
@@ -184,3 +208,3 @@ var warnings = [] | ||
optionalDependencies: [] | ||
}, warn) | ||
}, warn) | ||
t.ok(~warnings.indexOf("specifying dependencies as array is deprecated"), "deprecation warning") | ||
@@ -187,0 +211,0 @@ t.ok(~warnings.indexOf("specifying devDependencies as array is deprecated"), "deprecation warning") |
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
47946
27
1325