Comparing version 3.0.7 to 3.0.8
/** | ||
* Get escapes for the default escape set, which is all characters that cannot | ||
* be included in a JSON string literal. | ||
* be used between double quotes in a JSON string. | ||
* | ||
@@ -5,0 +5,0 @@ * - `\b` Backspace |
{ | ||
"name": "slashes", | ||
"description": "Add or remove backslashes (escape or unescape).", | ||
"version": "3.0.7", | ||
"version": "3.0.8", | ||
"license": "ISC", | ||
@@ -6,0 +6,0 @@ "keywords": [ |
@@ -23,3 +23,3 @@ # Slashes | ||
By default, `addSlashes` will escape the following JSON-unsafe characters. | ||
By default, `addSlashes` will escape the following characters. | ||
@@ -37,9 +37,9 @@ - Backspace (`\b`) | ||
```ts | ||
const encoded = addSlashes(`\n`); // "\\n" | ||
const escaped = addSlashes(`\n`); // "\\n" | ||
``` | ||
This default character set is the characters which cannot be included in a JSON string literal. | ||
This default character set is the characters which cannot be used between double quotes in a JSON string. | ||
```ts | ||
const jsonString = `{ "value": "${encoded}" }`; | ||
const jsonString = `{ "key": "${escaped}" }`; | ||
``` | ||
@@ -61,3 +61,3 @@ | ||
- `getEscapedJsonUnsafe` - (Default) Encode characters which cannot be used between quotes in a JSON string. | ||
- `getEscapedJsonUnsafe` - (Default) Encode characters which cannot be used between double quotes in a JSON string. | ||
- `getEscapedAny` - Encode _ANY_ character to a single letter (eg. `\n`) or an ES5 Unicode (eg. `\u0100`) escape sequence. | ||
@@ -64,0 +64,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
29313