diff options
Diffstat (limited to 'deps/npm/lib/shrinkwrap.js')
-rw-r--r-- | deps/npm/lib/shrinkwrap.js | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/deps/npm/lib/shrinkwrap.js b/deps/npm/lib/shrinkwrap.js index 0a3f53546c..5428e7255b 100644 --- a/deps/npm/lib/shrinkwrap.js +++ b/deps/npm/lib/shrinkwrap.js @@ -282,11 +282,15 @@ function checkPackageFile (dir, name) { return readFile( file, 'utf8' ).then((data) => { + const format = npm.config.get('format-package-lock') !== false + const indent = format ? detectIndent(data).indent : 0 + const newline = format ? detectNewline(data) : 0 + return { path: file, raw: data, - indent: detectIndent(data).indent, - newline: detectNewline(data) + indent, + newline } }).catch({code: 'ENOENT'}, () => {}) } |