strip-json-comments
Advanced tools
Comparing version
@@ -5,4 +5,6 @@ const singleComment = Symbol('singleComment'); | ||
const stripWithoutWhitespace = () => ''; | ||
const stripWithWhitespace = (string, start, end) => string.slice(start, end).replace(/\S/g, ' '); | ||
// Replace all characters except ASCII spaces, tabs and line endings with regular spaces to ensure valid JSON output. | ||
const stripWithWhitespace = (string, start, end) => string.slice(start, end).replace(/[^ \t\r\n]/g, ' '); | ||
const isEscaped = (jsonString, quotePosition) => { | ||
@@ -9,0 +11,0 @@ let index = quotePosition - 1; |
{ | ||
"name": "strip-json-comments", | ||
"version": "5.0.1", | ||
"version": "5.0.2", | ||
"description": "Strip comments from JSON. Lets you use comments in your JSON files!", | ||
@@ -16,2 +16,3 @@ "license": "MIT", | ||
"types": "./index.d.ts", | ||
"sideEffects": false, | ||
"engines": { | ||
@@ -18,0 +19,0 @@ "node": ">=14.16" |
8153
1.87%128
0.79%