Comparing version 1.13.4 to 1.13.5
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 { |
@@ -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": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
119558
10
2637
10
+ Addedbluebird@2.1.3(transitive)
- Removedbluebird@3.7.2(transitive)
Updatedbluebird@~ 2.1.3