Comparing version 3.0.8 to 3.0.9
{ | ||
"name": "slashes", | ||
"description": "Add or remove backslashes (escape or unescape).", | ||
"version": "3.0.8", | ||
"version": "3.0.9", | ||
"license": "ISC", | ||
@@ -6,0 +6,0 @@ "keywords": [ |
@@ -39,6 +39,6 @@ # Slashes | ||
This default character set is the characters which cannot be used between double quotes in a JSON string. | ||
The default character set are characters which cannot be used between double quotes in a JSON string. | ||
```ts | ||
const jsonString = `{ "key": "${escaped}" }`; | ||
const validJsonString = `{ "key": "${escaped}" }`; | ||
``` | ||
@@ -55,3 +55,3 @@ | ||
addSlashes(`\n`, { getEscaped: getEscapedJsonUnsafe }); // "\\n" | ||
addSlashes('...', { getEscaped: getEscapedJsonUnsafe }); | ||
``` | ||
@@ -67,3 +67,3 @@ | ||
```ts | ||
getEscaped(character: string): boolean | `\\${string}` | '' | ||
getEscaped(character: string): boolean | `\\${string}` | ||
``` | ||
@@ -99,3 +99,3 @@ | ||
removeSlashes('\\n', { getUnescaped: getUnescapedAny }); // "\n" | ||
removeSlashes('...', { getUnescaped: getUnescapedAny }); | ||
``` | ||
@@ -107,3 +107,3 @@ | ||
A custom `getUnescaped` implementation receives the escape sequence as the first argument, and the escape sequence code point number or `null` (for single letter escape sequences) as the second argument. It can return `true` to use standard decoding, `false` to treat the sequence as invalid (only removes the leading backslash), or a string to provide a custom decoded value for the escape sequence. | ||
A custom `getUnescaped` implementation receives the escape sequence as the first argument, and the escape sequence code point number or `null` (for single letter escape sequences) as the second argument. It can return `true` to use the standard decoding, `false` to treat the sequence as invalid (only removes the leading backslash), or a string (non-zero length) to provide a custom decoded value for the escape sequence. | ||
@@ -110,0 +110,0 @@ ```ts |
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
29315