Socket
Socket
Sign inDemoInstall

nedb

Package Overview
Dependencies
Maintainers
1
Versions
95
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nedb - npm Package Compare versions

Comparing version 0.0.4 to 0.0.5

4

lib/datastore.js

@@ -132,3 +132,3 @@ /**

if (Datastore.match(self.data[i], query)) {
res.push(self.data[i]);
res.push(model.deepCopy(self.data[i]));
}

@@ -152,3 +152,3 @@ }

if (Datastore.match(self.data[i], query)) {
return callback(null, self.data[i]);
return callback(null, model.deepCopy(self.data[i]));
}

@@ -155,0 +155,0 @@ }

{
"name": "nedb",
"version": "0.0.4",
"version": "0.0.5",
"author": {

@@ -5,0 +5,0 @@ "name": "tldr.io",

@@ -111,2 +111,26 @@ var Datastore = require('../lib/datastore')

it('If an object returned from the DB is modified and refetched, the original value should be found', function (done) {
d.insert({ a: 'something' }, function () {
d.findOne({}, function (err, doc) {
doc.a.should.equal('something');
doc.a = 'another thing';
doc.a.should.equal('another thing');
// Re-fetching with findOne should yield the persisted value
d.findOne({}, function (err, doc) {
doc.a.should.equal('something');
doc.a = 'another thing';
doc.a.should.equal('another thing');
// Re-fetching with find should yield the persisted value
d.find({}, function (err, docs) {
docs[0].a.should.equal('something');
done();
});
});
});
});
});
}); // ==== End of 'Insert' ==== //

@@ -113,0 +137,0 @@

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