Comparing version 0.0.3 to 0.0.4
@@ -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('/\\*/'); | ||
}); | ||
}); | ||
}); |
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
15784
373