Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

slashes

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

slashes - npm Package Compare versions

Comparing version 3.0.8 to 3.0.9

2

package.json
{
"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

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