Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

decomment

Package Overview
Dependencies
Maintainers
1
Versions
44
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

decomment - npm Package Compare versions

Comparing version 0.6.4 to 0.6.5

9

lib/parser.js

@@ -137,3 +137,10 @@ 'use strict';

closeIdx = code.indexOf(symbol, closeIdx + 1);
} while (closeIdx > 0 && code[closeIdx - 1] === '\\' && (closeIdx < 2 || code[closeIdx - 2] !== '\\'));
if (closeIdx > 0) {
var shIdx = closeIdx;
while (code[--shIdx] === '\\');
if ((closeIdx - shIdx) % 2) {
break;
}
}
} while (closeIdx > 0);
if (closeIdx < 0) {

@@ -140,0 +147,0 @@ break;

2

package.json
{
"name": "decomment",
"version": "0.6.4",
"version": "0.6.5",
"description": "Removes comments from JSON, JavaScript, CSS, HTML, etc.",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

@@ -26,2 +26,12 @@ 'use strict';

expect(decomment('`\\\\`')).toBe('`\\\\`');
expect(decomment("'\\\\\\''")).toBe("'\\\\\\''");
expect(decomment("'\\\\\\'';")).toBe("'\\\\\\'';");
expect(decomment('"\\\\\\""')).toBe('"\\\\\\""');
expect(decomment('"\\\\\\"";')).toBe('"\\\\\\"";');
expect(decomment('`\\\\\\``')).toBe('`\\\\\\``');
expect(decomment('`\\\\\\``;')).toBe('`\\\\\\``;');
});

@@ -28,0 +38,0 @@ });

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