Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

read-package-json

Package Overview
Dependencies
Maintainers
1
Versions
91
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

read-package-json - npm Package Compare versions

Comparing version 0.1.13 to 0.2.0

2

package.json
{
"name": "read-package-json",
"version": "0.1.13",
"version": "0.2.0",
"author": "Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me/)",

@@ -5,0 +5,0 @@ "description": "The thing npm uses to read package.json files with semantics and defaults and validation",

@@ -557,10 +557,15 @@ // vim: set softtabstop=16 shiftwidth=16:

function validName (file, data) {
if (!data.name) return new Error("No 'name' field")
if (!data.name) {
data.name = ""
return true
}
data.name = data.name.trim()
if (data.name.charAt(0) === "." ||
data.name.match(/[\/@\s\+%:]/) ||
data.name !== encodeURIComponent(data.name) ||
data.name.toLowerCase() === "node_modules" ||
data.name.toLowerCase() === "favicon.ico") {
return new Error("Invalid name: " +
JSON.stringify(data.name))
var m = "Invalid name: "
m += JSON.stringify(data.name)
return new Error(m)
}

@@ -581,3 +586,6 @@ return true

var v = data.version
if (!v) return new Error("no version");
if (!v) {
data.version = ""
return true
}
if (!semver.valid(v)) {

@@ -584,0 +592,0 @@ return new Error("invalid version: "+v)

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