diff options
author | Anna Henningsen <anna@addaleax.net> | 2018-04-05 22:51:49 +0200 |
---|---|---|
committer | Anna Henningsen <anna@addaleax.net> | 2018-04-05 23:00:02 +0200 |
commit | e37effe4cec98688e75d770f4d0b7f68927e2b73 (patch) | |
tree | e7efa0fc8a2139f9aba4b66ea3f3613262f20cef /deps/npm/lib/shrinkwrap.js | |
parent | 026f6b787a7a23597790f1f0b076c58a68c7c38b (diff) | |
download | android-node-v8-e37effe4cec98688e75d770f4d0b7f68927e2b73.tar.gz android-node-v8-e37effe4cec98688e75d770f4d0b7f68927e2b73.tar.bz2 android-node-v8-e37effe4cec98688e75d770f4d0b7f68927e2b73.zip |
Revert "deps: upgrade npm to 5.8.0"
This reverts commit 25a816dcda7b1db0929501acfe13f2fe5119759b.
PR-URL: https://github.com/nodejs/node/pull/19837
Reviewed-By: Gus Caplan <me@gus.host>
Diffstat (limited to 'deps/npm/lib/shrinkwrap.js')
-rw-r--r-- | deps/npm/lib/shrinkwrap.js | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/deps/npm/lib/shrinkwrap.js b/deps/npm/lib/shrinkwrap.js index 603056ec94..1db39f00cb 100644 --- a/deps/npm/lib/shrinkwrap.js +++ b/deps/npm/lib/shrinkwrap.js @@ -4,7 +4,6 @@ const BB = require('bluebird') const chain = require('slide').chain const detectIndent = require('detect-indent') -const detectNewline = require('detect-newline') const readFile = BB.promisify(require('graceful-fs').readFile) const getRequested = require('./install/get-requested.js') const id = require('./install/deps.js') @@ -19,7 +18,6 @@ const npm = require('./npm.js') const path = require('path') const readPackageTree = BB.promisify(require('read-package-tree')) const ssri = require('ssri') -const stringifyPackage = require('./utils/stringify-package') const validate = require('aproba') const writeFileAtomic = require('write-file-atomic') const unixFormatPath = require('./utils/unix-format-path.js') @@ -181,12 +179,11 @@ function save (dir, pkginfo, opts, cb) { { path: path.resolve(dir, opts.defaultFile || PKGLOCK), data: '{}', - indent: pkg && pkg.indent, - newline: pkg && pkg.newline + indent: (pkg && pkg.indent) || 2 } ) - const updated = updateLockfileMetadata(pkginfo, pkg && JSON.parse(pkg.raw)) - const swdata = stringifyPackage(updated, info.indent, info.newline) + const updated = updateLockfileMetadata(pkginfo, pkg && pkg.data) + const swdata = JSON.stringify(updated, null, info.indent) + '\n' if (swdata === info.raw) { // skip writing if file is identical log.verbose('shrinkwrap', `skipping write for ${path.basename(info.path)} because there were no changes.`) @@ -247,8 +244,8 @@ function checkPackageFile (dir, name) { return { path: file, raw: data, - indent: detectIndent(data).indent, - newline: detectNewline(data) + data: JSON.parse(data), + indent: detectIndent(data).indent || 2 } }).catch({code: 'ENOENT'}, () => {}) } |