Socket
Socket
Sign inDemoInstall

normalize-package-data

Package Overview
Dependencies
2
Maintainers
1
Versions
59
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.2.3 to 0.2.4

5

lib/fixer.js

@@ -337,3 +337,3 @@ var semver = require("semver")

function depObjectify (deps) {
function depObjectify (deps, type, warn) {
if (!deps) return {}

@@ -344,2 +344,3 @@ if (typeof deps === "string") {

if (!Array.isArray(deps)) return deps
warn("specifying " + type + " as array is deprecated")
var o = {}

@@ -362,3 +363,3 @@ deps.filter(function (d) {

if (!data[type]) return;
data[type] = depObjectify(data[type])
data[type] = depObjectify(data[type], type, warn)
})

@@ -365,0 +366,0 @@ }

2

package.json
{
"name": "normalize-package-data",
"version": "0.2.3",
"version": "0.2.4",
"author": "Meryn Stol <merynstol@gmail.com>",

@@ -5,0 +5,0 @@ "description": "Normalizes data that can be found in package.json files.",

@@ -173,2 +173,19 @@ var tap = require("tap")

tap.test("deprecation warning for array in dependencies fields", function(t) {
var a
var warnings = []
function warn(w) {
warnings.push(w)
}
normalize(a={
dependencies: [],
devDependencies: [],
optionalDependencies: []
}, warn)
t.ok(~warnings.indexOf("specifying dependencies as array is deprecated"), "deprecation warning")
t.ok(~warnings.indexOf("specifying devDependencies as array is deprecated"), "deprecation warning")
t.ok(~warnings.indexOf("specifying optionalDependencies as array is deprecated"), "deprecation warning")
t.end()
})
tap.test('no new globals', function(t) {

@@ -175,0 +192,0 @@ t.same(Object.keys(global), globals)

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc