Socket
Socket
Sign inDemoInstall

strip-json-comments

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

strip-json-comments - npm Package Compare versions

Comparing version 1.0.3 to 1.0.4

2

package.json
{
"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++;

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc