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

thinky

Package Overview
Dependencies
Maintainers
1
Versions
129
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

thinky - npm Package Compare versions

Comparing version 1.13.4 to 1.13.5

lib/errors.js

15

lib/query.js
var Promise = require('bluebird');
var util = require(__dirname+'/util.js');
var Errors = require(__dirname+'/errors.js');

@@ -57,3 +58,8 @@ function Query(model, query) {

if (parse === true) {
self._model._parse(result).then(resolve).error(reject);
if (result === null) {
reject(new Errors.DocumentNotFound())
}
else {
self._model._parse(result).then(resolve).error(reject);
}
}

@@ -76,3 +82,8 @@ else {

if (parse === true) {
resolve(self._model._parse(result))
if (result === null) {
reject(new Errors.DocumentNotFound())
}
else {
resolve(self._model._parse(result))
}
}

@@ -79,0 +90,0 @@ else {

28

lib/thinky.js

@@ -5,2 +5,3 @@ var rethinkdbdash = require('rethinkdbdash');

var Query = require(__dirname+'/query.js');
var Errors = require(__dirname+'/errors.js');

@@ -27,19 +28,22 @@ /*

this._options = {}
this._options.enforce_missing = (config.enforce_missing != null) ? config.enforce_missing : false;
this._options.enforce_extra = (config.enforce_extra != null) ? config.enforce_extra : false;
this._options.enforce_type = (config.enforce_type != null) ? config.enforce_type : 'loose'; // loose, strict, none
this._options.timeFormat = (config.timeFormat != null) ? config.timeFormat : 'native';
this._options.validate = (config.validate != null) ? config.validate : 'onsave'; // 'onsave' or 'oncreate'
self._options = {};
self._options.enforce_missing = (config.enforce_missing != null) ? config.enforce_missing : false;
self._options.enforce_extra = (config.enforce_extra != null) ? config.enforce_extra : false;
self._options.enforce_type = (config.enforce_type != null) ? config.enforce_type : 'loose'; // loose, strict, none
self._options.timeFormat = (config.timeFormat != null) ? config.timeFormat : 'native';
self._options.validate = (config.validate != null) ? config.validate : 'onsave'; // 'onsave' or 'oncreate'
this.r = rethinkdbdash(config);
this.Query = Query;
this.models = {};
self.r = rethinkdbdash(config);
self.Query = Query;
self.models = {};
// Can we start using the database?
this._dbReady = false;
this._onDbReady = []; // functions to execute once the database is ready
self._dbReady = false;
self._onDbReady = []; // functions to execute once the database is ready
// Export errors
self.Errors = Errors;
// Create the default database
var r = this.r;
var r = self.r;
r.dbList().contains(config.db).do(function(result) {

@@ -46,0 +50,0 @@ return r.branch(

{
"name": "thinky",
"version": "1.13.4",
"version": "1.13.5",
"description": "RethinkDB ORM for Node.js",

@@ -28,3 +28,3 @@ "main": "lib/thinky.js",

"rethinkdbdash": "~1.13.0",
"bluebird": ">= 1.2.1"
"bluebird": "~ 2.1.3"
},

@@ -31,0 +31,0 @@ "devDependencies": {

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