read-package-json-fast
Advanced tools
Comparing version 1.0.2 to 1.0.3
@@ -7,2 +7,3 @@ const {promisify} = require('util') | ||
.then(data => parse(data)) | ||
.then(add_id) | ||
.then(fixBundled) | ||
@@ -18,2 +19,8 @@ .then(foldinOptionalDeps) | ||
const add_id = data => { | ||
if (data.name && data.version) | ||
data._id = `${data.name}@${data.version}` | ||
return data | ||
} | ||
const foldinOptionalDeps = data => { | ||
@@ -20,0 +27,0 @@ const od = data.optionalDependencies |
{ | ||
"name": "read-package-json-fast", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "Like read-package-json, but faster", | ||
@@ -5,0 +5,0 @@ "author": "Isaac Z. Schlueter <i@izs.me> (https://izs.me)", |
@@ -37,2 +37,4 @@ # read-package-json-fast | ||
- Fold `optionalDependencies` into `dependencies`. | ||
- Set the `_id` property if name and version are set. (This is | ||
load-bearing in a few places within the npm CLI.) | ||
@@ -39,0 +41,0 @@ ## WHAT THIS MODULE DOES NOT DO |
@@ -159,1 +159,6 @@ const t = require('tap') | ||
}) | ||
t.test('set _id if name and version set', t => | ||
t.resolveMatch(rpj(t.testdir({ | ||
'package.json': JSON.stringify({name:'a', version: '1.2.3'}), | ||
}) + '/package.json'), { _id: 'a@1.2.3' })) |
Sorry, the diff of this file is too big to display
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
133084
3828
52