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 1.0.4 to 1.0.5

2

package.json
{
"name": "slashes",
"version": "1.0.4",
"version": "1.0.5",
"description": "Add or strip backslashes.",

@@ -5,0 +5,0 @@ "main": "slashes.js",

@@ -17,6 +17,4 @@ # slashes

The goal of this utility is to make a string safe for concatenation or injection into JavaScript source.
The goal of this utility is to make a string safe for concatenation or injection into JavaScript source. The following
snippet would throw an exception.
```js

@@ -28,5 +26,5 @@ var foo = "\\bar";

You might expect that to output `\bar` but instead you will see `ar`, because the source string ends up being
`console.log('\bar');` which is interpreted as starting with an escaped "b" rather than a backslash and then a "b". It
can be fixed using he `add` method.
You might expect the above snippet to output `\bar` but instead you will see `ar`, because the source string ends up
being `console.log('\bar');` which is interpreted as starting with an escaped "b" rather than a backslash and then a
"b". It can be fixed using the `add` method.

@@ -33,0 +31,0 @@ ```js

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