Comparing version 1.3.0 to 1.4.0
@@ -28,2 +28,4 @@ #!/usr/bin/env node | ||
var indent = detectIndent(file).indent || ' '; | ||
// Detect end of line if any | ||
var eol = /}(\r\n|\n|\r)$/.exec(file, 'gm'); | ||
@@ -42,4 +44,4 @@ // Parse JSON | ||
// Saving to file | ||
fs.writeFile(filePath, JSON.stringify(sortedObject, null, indent)); | ||
fs.writeFile(filePath, JSON.stringify(sortedObject, null, indent) + ((eol && eol.length === 2) ? eol[1] : '')); | ||
} | ||
} |
{ | ||
"name": "sort-json", | ||
"version": "1.3.0", | ||
"version": "1.4.0", | ||
"description": "Takes a json-file and return a copy of the same file, but sorted", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
2577
47