Socket
Socket
Sign inDemoInstall

normalize-package-data

Package Overview
Dependencies
Maintainers
1
Versions
60
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

normalize-package-data - npm Package Compare versions

Comparing version 0.2.4 to 0.2.5

lib/core_module_names.json

5

lib/fixer.js

@@ -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)

2

package.json
{
"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")

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc