Skip to content

Commit f5f895b

Browse files
committed
do not pretty-print package-lock.json to prevent corrupting git lines count history
1 parent 199c970 commit f5f895b

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

lib/shrinkwrap.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,11 +270,18 @@ function checkPackageFile (dir, name) {
270270
return readFile(
271271
file, 'utf8'
272272
).then((data) => {
273+
if (name === PKGLOCK || name === SHRINKWRAP) {
274+
const indent = 0
275+
const newline = 0
276+
} else {
277+
const indent = detectIndent(data).indent
278+
const newline = detectNewline(data)
279+
}
273280
return {
274281
path: file,
275282
raw: data,
276-
indent: detectIndent(data).indent,
277-
newline: detectNewline(data)
283+
indent,
284+
newline
278285
}
279286
}).catch({code: 'ENOENT'}, () => {})
280287
}

0 commit comments

Comments
 (0)