Socket
Socket
Sign inDemoInstall

bookshelf-modelbase

Package Overview
Dependencies
Maintainers
2
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bookshelf-modelbase - npm Package Compare versions

Comparing version 2.8.1 to 2.9.0

4

lib/index.js

@@ -158,1 +158,5 @@ var extend = require('xtend')

}
module.exports.pluggable = function (bookshelf, params) {
bookshelf.Model = module.exports.apply(null, arguments)
}

2

package.json
{
"name": "bookshelf-modelbase",
"version": "2.8.1",
"version": "2.9.0",
"description": "Extensible ModelBase for bookshelf-based model layers",

@@ -5,0 +5,0 @@ "main": "./lib",

@@ -36,2 +36,4 @@ # bookshelf-modelbase

var ModelBase = require('bookshelf-modelbase')(bookshelf);
// Or initialize as a bookshelf plugin
bookshelf.plugin(require('bookshelf-modelbase').pluggable);

@@ -38,0 +40,0 @@ var User = ModelBase.extend({

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

/* global describe, before, beforeEach, it */
/* global describe, before, after, beforeEach, it */

@@ -35,2 +35,12 @@ var Joi = require('joi')

describe('initialize', function () {
var origModelBase
before(function () {
origModelBase = bookshelf.Model
})
after(function () {
bookshelf.Model = origModelBase
})
it('should error if not passed bookshelf object', function () {

@@ -41,2 +51,14 @@ expect(function () {

})
it('should be separately applyable', function () {
var Model = require('../lib/index')(bookshelf)
expect(Model.findOne).to.be.a('function')
expect(bookshelf.Model.findOne).to.be.undefined()
})
it('should be usable as a bookshelf plugin', function () {
expect(bookshelf.Model.findOne).to.be.undefined()
bookshelf.plugin(function () {
require('../lib/index').pluggable.apply(null, arguments)
})
expect(bookshelf.Model.findOne).to.be.a('function')
})
})

@@ -43,0 +65,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