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.0.3 to 0.0.4

2

index.js

@@ -109,3 +109,3 @@ 'use strict';

} while (++nextIdx < l);
return true;
return false;
}

@@ -112,0 +112,0 @@

{
"name": "decomment",
"version": "0.0.3",
"version": "0.0.4",
"description": "Removes comments from JSON or JavaScript.",

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

@@ -38,4 +38,4 @@ decomment

* Removes both single-line and multi-line comments
* Removes empty lines between multi-line comments
* Removes unnecessary gaps left by comment blocks
* Can handle valid JSON or JavaScript of any size
* Compliant with ECMAScript 6

@@ -11,2 +11,44 @@ 'use strict';

describe("with apostrophe", function () {
it("must ignore the apostrophe", function () {
expect(decomment("/'/")).toBe("/'/");
expect(decomment("/\'/")).toBe("/'/");
});
});
describe("with a quote", function () {
it("must ignore the quote", function () {
expect(decomment('/"/')).toBe('/"/');
expect(decomment('/\"/')).toBe('/"/');
});
});
describe("with an es6 apostrophe", function () {
it("must ignore the apostrophe", function () {
expect(decomment('/`/')).toBe('/`/');
expect(decomment('/\`/')).toBe('/`/');
});
});
describe("with a back-slash", function () {
it("must ignore the back-slash", function () {
expect(decomment('/\\//')).toBe('/\\//');
expect(decomment('/\\\//')).toBe('/\\//');
});
});
describe("with a multi-line", function () {
it("must ignore the multi-line", function () {
expect(decomment('/\\/*/')).toBe('/\\/*/');
expect(decomment('/\\/\*/')).toBe('/\\/*/');
});
});
describe("with a multi-line opener", function () {
it("must ignore the multi-line", function () {
expect(decomment('/\\*/')).toBe('/\\*/');
expect(decomment('/\\\*/')).toBe('/\\*/');
});
});
});
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