Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/stringify-package/index.js')
-rw-r--r--node_modules/stringify-package/index.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/node_modules/stringify-package/index.js b/node_modules/stringify-package/index.js
index 0cc9de0a3..cd291f295 100644
--- a/node_modules/stringify-package/index.js
+++ b/node_modules/stringify-package/index.js
@@ -7,7 +7,8 @@ const CRLF = '\r\n'
const LF = '\n'
function stringifyPackage (data, indent, newline) {
- const json = JSON.stringify(data, null, indent || DEFAULT_INDENT)
+ indent = indent || (indent === 0 ? 0 : DEFAULT_INDENT)
+ const json = JSON.stringify(data, null, indent)
if (newline === CRLF) {
return json.replace(/\n/g, CRLF) + CRLF