strip-json-comments
Advanced tools
Comparing version 1.0.3 to 1.0.4
{ | ||
"name": "strip-json-comments", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"description": "Strip comments from JSON. Lets you use comments in your JSON files!", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -11,2 +11,5 @@ /*! | ||
var singleComment = 1; | ||
var multiComment = 2; | ||
function stripJsonComments(str) { | ||
@@ -36,5 +39,5 @@ var currentChar; | ||
if (!insideComment && currentChar + nextChar === '//') { | ||
insideComment = 'single'; | ||
insideComment = singleComment; | ||
i++; | ||
} else if (insideComment === 'single' && currentChar + nextChar === '\r\n') { | ||
} else if (insideComment === singleComment && currentChar + nextChar === '\r\n') { | ||
insideComment = false; | ||
@@ -45,9 +48,9 @@ i++; | ||
continue; | ||
} else if (insideComment === 'single' && currentChar === '\n') { | ||
} else if (insideComment === singleComment && currentChar === '\n') { | ||
insideComment = false; | ||
} else if (!insideComment && currentChar + nextChar === '/*') { | ||
insideComment = 'multi'; | ||
insideComment = multiComment; | ||
i++; | ||
continue; | ||
} else if (insideComment === 'multi' && currentChar + nextChar === '*/') { | ||
} else if (insideComment === multiComment && currentChar + nextChar === '*/') { | ||
insideComment = false; | ||
@@ -54,0 +57,0 @@ i++; |
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
6132
95