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

mongo-escape

Package Overview
Dependencies
Maintainers
2
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mongo-escape - npm Package Compare versions

Comparing version 2.0.1 to 2.0.2

2

package.json
{
"name": "mongo-escape",
"version": "2.0.1",
"version": "2.0.2",
"author": {

@@ -5,0 +5,0 @@ "name": "Tim Kuijsten",

@@ -17,23 +17,26 @@ # mongo-escape

var assert = require('assert')
var me = require('mongo-escape').escape
var userInput
```js
var assert = require('assert')
var me = require('mongo-escape').escape
userInput = me('$in')
var userInput = me('$in')
assert.equal(userInput, '$in')
assert.equal(userInput, '$in')
```
Now escape all keys in an object:
userInput = me({
'foo': 'bar',
'ba.z': {
'$in': 'quz'
}
})
```js
userInput = me({
'foo': 'bar',
'ba.z': {
'$in': 'quz'
}
})
assert.deepEqual(userInput, {
'foo': 'bar',
'ba.z': { '$in': 'quz' }
})
assert.deepEqual(userInput, {
'foo': 'bar',
'ba.z': { '$in': 'quz' }
})
```

@@ -40,0 +43,0 @@ Note: beware that keys in objects are replaced in-place, the object is not

Sorry, the diff of this file is not supported yet

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