Comparing version 5.5.1 to 5.5.2
@@ -1,2 +0,2 @@ | ||
///// <reference path="./typings/DefinitelyTyped/tsd.d.ts" /> | ||
/// <reference path="./typings/DefinitelyTyped/tsd.d.ts" /> | ||
/// <reference path="./typings/skmatc/skmatc.d.ts" /> |
//# sourceMappingURL=../lib/Cache.js.map |
@@ -0,0 +0,0 @@ var MongoDB = require('mongodb'); |
/// <reference path="../_references.d.ts" /> | ||
//# sourceMappingURL=../lib/CacheDirector.js.map |
@@ -0,0 +0,0 @@ /// <reference path="../../_references.d.ts" /> |
@@ -0,0 +0,0 @@ var Bluebird = require('bluebird'); |
/// <reference path="../_references.d.ts" /> | ||
//# sourceMappingURL=../lib/Configuration.js.map |
@@ -0,0 +0,0 @@ /// <reference path="../_references.d.ts" /> |
@@ -0,0 +0,0 @@ var Bluebird = require('bluebird'); |
/// <reference path="../_references.d.ts" /> | ||
//# sourceMappingURL=../lib/General.js.map |
//# sourceMappingURL=../lib/Hooks.js.map |
//# sourceMappingURL=../lib/Index.js.map |
@@ -64,3 +64,2 @@ var _ = require('lodash'); | ||
_.merge(conditions, { _id: _this._modified._id }); | ||
conditions = _this._model.helpers.transformToDB(conditions); | ||
if (!changes) { | ||
@@ -103,6 +102,5 @@ var validation = _this._model.helpers.validate(_this._modified); | ||
}).then(function (changed) { | ||
conditions = _this._model.helpers.convertToDB({ _id: _this._modified._id }); | ||
if (!changed) { | ||
return _.cloneDeep(_this._modified); | ||
} | ||
conditions = { _id: _this._modified._id }; | ||
if (!changed) | ||
return _this._modified; | ||
return new Bluebird(function (resolve, reject) { | ||
@@ -116,7 +114,12 @@ _this._model.collection.findOne(conditions, function (err, latest) { | ||
}).then(function (latest) { | ||
if (!latest) { | ||
_this._isNew = true; | ||
_this._original = _.cloneDeep(_this._modified); | ||
return Bluebird.resolve(_this); | ||
} | ||
return _this._model.handlers.documentReceived(conditions, latest, function (value) { | ||
_this._isPartial = false; | ||
_this._isNew = false; | ||
_this._original = value; | ||
_this._modified = _.clone(value); | ||
_this._modified = value; | ||
_this._original = _.cloneDeep(value); | ||
return _this; | ||
@@ -123,0 +126,0 @@ }); |
//# sourceMappingURL=../lib/Middleware.js.map |
@@ -0,0 +0,0 @@ function ExpressMiddlewareFactory(core) { |
@@ -0,0 +0,0 @@ var Bluebird = require('bluebird'); |
//# sourceMappingURL=../lib/ModelOptions.js.map |
//# sourceMappingURL=../lib/Plugins.js.map |
/// <reference path="../_references.d.ts" /> | ||
//# sourceMappingURL=../lib/Schema.js.map |
@@ -0,0 +0,0 @@ /// <reference path="../../_references.d.ts" /> |
@@ -126,4 +126,2 @@ /// <reference path="../_references.d.ts" /> | ||
conditions = this._model.helpers.transformToDB(conditions); | ||
if (!changes) { | ||
@@ -164,9 +162,7 @@ var validation = this._model.helpers.validate(this._modified); | ||
}).then((changed: boolean) => { | ||
conditions = this._model.helpers.convertToDB({ _id: this._modified._id }); | ||
if (!changed) { | ||
return _.cloneDeep(this._modified); | ||
} | ||
conditions = { _id: this._modified._id }; | ||
if (!changed) return this._modified; | ||
return new Bluebird<TDocument>((resolve, reject) => { | ||
this._model.collection.findOne(conditions,(err: Error, latest) => { | ||
this._model.collection.findOne(conditions, (err: Error, latest) => { | ||
if (err) return reject(err); | ||
@@ -177,7 +173,13 @@ return resolve(latest); | ||
}).then((latest: TDocument) => { | ||
return this._model.handlers.documentReceived(conditions, latest,(value) => { | ||
if(!latest) { | ||
this._isNew = true; | ||
this._original = _.cloneDeep(this._modified); | ||
return Bluebird.resolve(<TInstance><any>this); | ||
} | ||
return this._model.handlers.documentReceived(conditions, latest, (value) => { | ||
this._isPartial = false; | ||
this._isNew = false; | ||
this._original = value; | ||
this._modified = _.clone<TDocument>(value); | ||
this._modified = value; | ||
this._original = _.cloneDeep(value); | ||
return <TInstance><any>this; | ||
@@ -184,0 +186,0 @@ }); |
{ | ||
"name": "iridium", | ||
"version": "5.5.1", | ||
"version": "5.5.2", | ||
"author": "Benjamin Pannell <admin@sierrasoftworks.com>", | ||
@@ -5,0 +5,0 @@ "description": "A custom lightweight ORM for MongoDB designed for power-users", |
Sorry, the diff of this file is not supported yet
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
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
360895
3697