mongo-escape
Advanced tools
Comparing version 2.0.1 to 2.0.2
{ | ||
"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
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
17373
104
0