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

bookshelf

Package Overview
Dependencies
Maintainers
1
Versions
87
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bookshelf - npm Package Compare versions

Comparing version 0.2.3 to 0.2.4

50

bookshelf.js

@@ -1,2 +0,2 @@

// Bookshelf.js 0.2.3
// Bookshelf.js 0.2.4

@@ -28,3 +28,3 @@ // (c) 2013 Tim Griesser

// Keep in sync with `package.json`.
Bookshelf.VERSION = '0.2.3';
Bookshelf.VERSION = '0.2.4';

@@ -419,10 +419,16 @@ // We're using `Backbone.Events` rather than `EventEmitter`,

// In case we need to reference the `previousAttributes` for the model
// in the following event handlers.
options.previousAttributes = model._previousAttributes;
model._reset();
return when.all([
model.triggerThen((method === 'insert' ? 'created' : 'updated'), model, resp, options),
model.triggerThen('saved', model, resp, options)
]).then(function() {
return model._reset();
});
})
.ensure(function() { model.resetQuery(); });
]);
}).then(function() {
return model;
});
},

@@ -444,4 +450,2 @@

});
}).ensure(function() {
model.resetQuery();
});

@@ -464,3 +468,4 @@ },

for (var key in relations) {
attrs[key] = relations[key].toJSON();
var relation = relations[key];
attrs[key] = relation.toJSON ? relation.toJSON() : relation;
}

@@ -950,5 +955,4 @@ return attrs;

}()).then(function() {
syncing.resetQuery();
return sync.query.select(columns);
}).ensure(function() {
syncing.resetQuery();
});

@@ -959,10 +963,6 @@ },

insert: function() {
var syncing = this.syncing;
var syncing = this.syncing.resetQuery();
return this.query
.idAttribute(syncing.idAttribute)
.insert(syncing.format(extendNull(syncing.attributes)))
.then(function(resp) {
syncing._previousAttributes = extendNull(syncing.attributes);
return resp;
});
.insert(syncing.format(extendNull(syncing.attributes)));
},

@@ -972,10 +972,6 @@

update: function(attrs, options) {
var syncing = this.syncing;
var syncing = this.syncing.resetQuery();
return this.query
.where(syncing.idAttribute, syncing.id)
.update(syncing.format(extendNull(syncing.attributes)))
.then(function(resp) {
syncing._previousAttributes = extendNull(syncing.attributes);
return resp;
});
.update(syncing.format(extendNull(syncing.attributes)));
},

@@ -985,6 +981,6 @@

del: function() {
var wheres, syncing = this.syncing;
if (this.syncing.id != null) {
var wheres, syncing = this.syncing.resetQuery();
if (syncing.id != null) {
wheres = {};
wheres[this.syncing.idAttribute] = this.syncing.id;
wheres[syncing.idAttribute] = syncing.id;
}

@@ -991,0 +987,0 @@ if (!wheres && this.query.wheres.length === 0) {

{
"name": "bookshelf",
"version": "0.2.3",
"version": "0.2.4",
"description": "A lightweight Active Record ORM for PostgreSQL, MySQL, and SQLite3, influenced by Backbone.js",

@@ -10,3 +10,6 @@ "main": "bookshelf.js",

"homepage": "http://bookshelfjs.org",
"repository": "https://github.com/tgriesser/bookshelf",
"repository": {
"type": "git",
"url": "https://github.com/tgriesser/bookshelf.git"
},
"keywords": [

@@ -20,18 +23,14 @@ "orm",

],
"repository":{
"type": "git",
"url": "https://github.com/tgriesser/bookshelf.git"
},
"dependencies": {
"backbone": "1.0.x",
"knex": ">=0.1.8",
"underscore": "~1.4.4",
"backbone": "~1.0.0",
"inflection": "~1.2.x",
"when": "~2.1.0",
"trigger-then": ">=0.1.1"
"when": "~2.2.1",
"trigger-then": "~0.1.1",
"underscore": "~1.5.1",
"knex": "~0.1.8"
},
"devDependencies": {
"mocha": "1.7.x",
"mocha": "~1.12.0",
"mysql": "~2.0.0-alpha7",
"pg": "~0.15.1",
"pg": "~2.3.0",
"sqlite3": "~2.1.7",

@@ -43,3 +42,3 @@ "objectdump": "~0.3.0",

"name": "Tim Griesser",
"web": "https://github.com/tgriesser"
"web": "https://github.com/tgriesser"
},

@@ -46,0 +45,0 @@ "license": "MIT",

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