New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

backbone-db

Package Overview
Dependencies
Maintainers
2
Versions
50
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

backbone-db - npm Package Compare versions

Comparing version 0.4.2 to 0.4.3

6

lib/db.js

@@ -209,2 +209,8 @@ var Backbone = require('backbone');

this.store().getItem(key, function (err, data) {
if (err || !data) {
if (options.ignoreFailures) {
return cb(null, model);
}
return cb(err || new Error('Cannot INC, not found.'));
}
data = JSON.parse(data);

@@ -211,0 +217,0 @@ var value = data.hasOwnProperty(attribute) ? data[attribute] : 0;

2

package.json
{
"name": "backbone-db",
"version": "0.4.2",
"version": "0.4.3",
"description": "Key-Value database storage interface, localStorage and in-process implementations",

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

@@ -24,3 +24,3 @@ var Db = require('../');

it('should include all the variables', function (t) {
it('should include all the variables when saving a Model', function (t) {
var Model = this.Model;

@@ -53,3 +53,3 @@ var m = new Model({

it('should inc counter', function (t) {
it('should inc Model counter', function (t) {
var m = new this.Model({

@@ -66,3 +66,3 @@ id: 1

},
error: function () {
error: function (model, err) {
console.error(err);

@@ -91,2 +91,24 @@ assert.ok(false);

});
it('should fail inc operation gracefully', function (t) {
var m = new this.Model({
id: 2
});
var opts = {
inc: {
attribute: 'counter',
amount: 1
},
ignoreFailures: true,
success: function (model) {
t();
},
error: function (model, err) {
console.error('ERR', err);
assert.ok(false);
}
};
m.save(null, opts);
});
it('should remove the model', function (t) {

@@ -93,0 +115,0 @@ var m2 = new this.Model({

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