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

bookshelf

Package Overview
Dependencies
Maintainers
7
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 1.0.1 to 1.1.0

.nycrc.yml

15

CHANGELOG.md
## Change Log
**1.1.0** <small>_Jan 31, 2020_</small> - [Diff](https://github.com/bookshelf/bookshelf/compare/1.0.1...1.1.0)
#### Features
- Add option to disable the count information in `fetchPage`: [#2045](https://github.com/bookshelf/bookshelf/pull/2045)
#### Tests
- Small refactor to some tests: [#2050](https://github.com/bookshelf/bookshelf/pull/2050)
#### Dependencies
- Update some dependencies to their latest versions: [#2053](https://github.com/bookshelf/bookshelf/pull/2053)
- Update Knex to version 0.20.8: [#2049](https://github.com/bookshelf/bookshelf/pull/2049)
**1.0.1** <small>_Oct 06, 2019_</small> - [Diff](https://github.com/bookshelf/bookshelf/compare/1.0.0...1.0.1)

@@ -4,0 +19,0 @@

5

lib/base/model.js

@@ -709,3 +709,6 @@ // Base Model

const model = new this.constructor(this.attributes);
Object.assign(model.relations, _.mapValues(this.relations, (r) => r.clone()));
Object.assign(
model.relations,
_.mapValues(this.relations, (r) => r.clone())
);
model._previousAttributes = _.clone(this._previousAttributes);

@@ -712,0 +715,0 @@ model.changed = _.clone(this.changed);

14

lib/helpers.js

@@ -60,2 +60,10 @@ /* eslint no-console: 0 */

const metadata = !options.limit && !options.offset ? {page, pageSize} : {offset, limit};
if (options.disableCount) {
return paginate().then((rows) => {
return Object.assign(rows, {pagination: metadata});
});
}
const count = () => {

@@ -89,4 +97,2 @@ const notNeededQueries = ['orderByBasic', 'orderByRaw', 'groupByBasic', 'groupByRaw'];

.then((result) => {
const metadata = !options.limit && !options.offset ? {page, pageSize} : {offset, limit};
if (result && result.length == 1) {

@@ -103,8 +109,6 @@ // We shouldn't have to do this, instead it should be result.models[0].get('count') but SQLite and MySQL

}
return metadata;
});
};
return Promise.join(paginate(), count(), (rows, metadata) => {
return Promise.join(paginate(), count(), (rows) => {
const pageCount = Math.ceil(metadata.rowCount / limit);

@@ -111,0 +115,0 @@ const pageData = Object.assign(metadata, {pageCount});

{
"name": "bookshelf",
"version": "1.0.1",
"version": "1.1.0",
"description": "A lightweight ORM for PostgreSQL, MySQL, and SQLite3",

@@ -9,4 +9,4 @@ "main": "bookshelf.js",

"lint": "eslint bookshelf.js lib/",
"cover": "npm run lint && istanbul cover _mocha -- --check-leaks -t 10000 -b",
"test": "npm run lint && mocha --check-leaks -t 10000 -b",
"cover": "npm run lint && nyc mocha --check-leaks -t 10000 -b",
"test": "npm run lint && mocha --check-leaks -t 10000 -b",
"jsdoc": "./scripts/jsdoc.sh",

@@ -29,3 +29,3 @@ "postpublish": "./scripts/postpublish.sh"

"dependencies": {
"bluebird": "^3.5.5",
"bluebird": "^3.7.2",
"create-error": "~0.3.1",

@@ -49,15 +49,15 @@ "inflection": "^1.12.0",

"chai": "^4.2.0",
"eslint": "^6.4.0",
"eslint-config-prettier": "^6.3.0",
"eslint-plugin-prettier": "^3.1.1",
"eslint": "^6.8.0",
"eslint-config-prettier": "^6.10.0",
"eslint-plugin-prettier": "^3.1.2",
"husky": "^3.0.5",
"istanbul": "^0.4.5",
"jsdoc": "^3.6.3",
"knex": "~0.19.4",
"knex": "~0.20.8",
"lint-staged": "^9.2.5",
"mocha": "^6.2.0",
"mysql": "^2.17.1",
"pg": "^7.11.0",
"mocha": "^7.0.1",
"mysql": "^2.18.1",
"nyc": "^15.0.0",
"pg": "^7.18.1",
"prettier": "^1.18.2",
"sinon": "^7.4.2",
"sinon": "^8.1.1",
"sinon-chai": "^3.3.0",

@@ -68,3 +68,3 @@ "sqlite3": "^4.1.0",

"peerDependencies": {
"knex": ">=0.15.0 <0.20.0"
"knex": ">=0.15.0 <0.21.0"
},

@@ -71,0 +71,0 @@ "author": {

Sorry, the diff of this file is too big to display

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