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

read-package-json

Package Overview
Dependencies
Maintainers
6
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 2.0.13 to 2.1.0

10

CHANGELOG.md

@@ -5,2 +5,12 @@ # Change Log

<a name="2.1.0"></a>
# [2.1.0](https://github.com/npm/read-package-json/compare/v2.0.13...v2.1.0) (2019-08-13)
### Features
* support bundleDependencies: true ([76f6f42](https://github.com/npm/read-package-json/commit/76f6f42))
<a name="2.0.13"></a>

@@ -7,0 +17,0 @@ ## [2.0.13](https://github.com/npm/read-package-json/compare/v2.0.12...v2.0.13) (2018-03-08)

2

package.json
{
"name": "read-package-json",
"version": "2.0.13",
"version": "2.1.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",

@@ -20,2 +20,3 @@ var fs

readJson.extraSet = [
bundleDependencies,
gypfile,

@@ -328,2 +329,19 @@ serverjs,

function bundleDependencies (file, data, cb) {
var bd = 'bundleDependencies'
var bdd = 'bundledDependencies'
// normalize key name
if (data[bdd] !== undefined) {
if (data[bd] === undefined) data[bd] = data[bdd]
delete data[bdd]
}
if (data[bd] === false) delete data[bd]
else if (data[bd] === true) {
data[bd] = Object.keys(data.dependencies || {})
} else if (data[bd] !== undefined && !Array.isArray(data[bd])) {
delete data[bd]
}
return cb(null, data)
}
function githead (file, data, cb) {

@@ -390,13 +408,12 @@ if (data.gitHead) return cb(null, data)

var relName = data.bin[key]
try {
var binPath = path.resolve(dirName, relName)
fs.stat(binPath, (err) => handleExists(relName, !err))
} catch (error) {
if (error.message === 'Arguments to path.resolve must be strings' || error.message.indexOf('Path must be a string') === 0) {
warn('Bin filename for ' + key + ' is not a string: ' + util.inspect(relName))
handleExists(relName, true)
} else {
cb(error)
}
if (typeof relName !== 'string') {
var msg = 'Bin filename for ' + key +
' is not a string: ' + util.inspect(relName)
warn(msg)
delete data.bin[key]
handleExists(relName, true)
return
}
var binPath = path.resolve(dirName, relName)
fs.stat(binPath, (err) => handleExists(relName, !err))
})

@@ -403,0 +420,0 @@ }

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