Comparing version 1.0.1 to 1.0.2
{ | ||
"name": "slashes", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "Add or strip backslashes.", | ||
@@ -5,0 +5,0 @@ "main": "slashes.js", |
@@ -8,2 +8,9 @@ # slashes | ||
The `add` method will prefix backslash (`\`), double quote (`"`), and single quote (`'`) characters with | ||
backslashes. Null (`\0`) characters will be replaced with backslash zero `"\\0"`. | ||
The `strip` method replaces all sequences of two characters that start with a backslash, with the second character in | ||
the sequence. There are two caveats. A single non-escaped slash at the end of the string will be removed. Backslash | ||
zero `"\\0"` will become a null (`\0`) character. | ||
## Install | ||
@@ -68,2 +75,2 @@ | ||
Note that in JavaScript, "\0" and "\u0000" are identical. The `add` method will convert both to "\\0". | ||
Note that in JavaScript, "\0" and "\u0000" are identical. The `add` method will convert both to `"\\0"`. |
@@ -23,3 +23,3 @@ "use strict"; | ||
--count; | ||
str = str.replace(/\\(.)/g, strip_replace); | ||
str = str.replace(/\\(.|$)/g, strip_replace); | ||
} | ||
@@ -26,0 +26,0 @@ |
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
4796
74