Join our webinar on Wednesday, June 26, at 1pm EDTHow Chia Mitigates Risk in the Crypto Industry.Register
Socket
Socket
Sign inDemoInstall

nedb

Package Overview
Dependencies
99
Maintainers
1
Versions
95
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.1.4 to 1.2.0

7

lib/model.js

@@ -412,8 +412,9 @@ /**

try {
keys = Object.keys(updateQuery[m]);
} catch (e) {
// Can't rely on Object.keys throwing on non objects since ES6{
// Not 100% satisfying as non objects can be interpreted as objects but no false negatives so we can live with it
if (typeof updateQuery[m] !== 'object') {
throw "Modifier " + m + "'s argument must be an object";
}
keys = Object.keys(updateQuery[m]);
keys.forEach(function (k) {

@@ -420,0 +421,0 @@ modifierFunctions[m](newDoc, k, updateQuery[m][k]);

{
"name": "nedb",
"version": "1.1.4",
"version": "1.2.0",
"author": {

@@ -24,8 +24,8 @@ "name": "Louis Chatriot",

"async": "0.2.10",
"underscore": "~1.4.4",
"binary-search-tree": "0.2.4",
"mkdirp": "~0.5.1"
"mkdirp": "~0.5.1",
"underscore": "~1.4.4"
},
"devDependencies": {
"chai": "1.0.x",
"chai": "^3.2.0",
"mocha": "1.4.x",

@@ -32,0 +32,0 @@ "request": "2.9.x",

var model = require('../lib/model')
, should = require('chai').should()
, assert = require('chai').assert
, expect = require('chai').expect
, _ = require('underscore')

@@ -312,5 +313,5 @@ , async = require('async')

(function () {
expect(function () {
model.modify(obj, updateQuery);
}).should.throw();
}).to.throw("You cannot change a document's _id");

@@ -325,5 +326,5 @@ updateQuery._id = 'keepit';

(function () {
expect(function () {
model.modify(obj, updateQuery);
}).should.throw();
}).to.throw("You cannot mix modifiers and normal fields");
});

@@ -333,7 +334,7 @@

var obj = { some: 'thing' }
, updateQuery = { $set: 'this exists', $modify: 'not this one' };
, updateQuery = { $set: { it: 'exists' }, $modify: 'not this one' };
(function () {
expect(function () {
model.modify(obj, updateQuery);
}).should.throw();
}).to.throw(/^Unknown modifier .modify/);
});

@@ -345,5 +346,5 @@

(function () {
expect(function () {
model.modify(obj, updateQuery);
}).should.throw();
}).to.throw(/Modifier .set's argument must be an object/);
});

@@ -350,0 +351,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc