hydrate-mongodb
Advanced tools
Comparing version 1.3.1 to 1.3.2
{ | ||
"name": "hydrate-mongodb", | ||
"description": "An Object Document Mapper (ODM) for MongoDB.", | ||
"version": "1.3.1", | ||
"version": "1.3.2", | ||
"author": { | ||
@@ -6,0 +6,0 @@ "name": "Artifact Health, LLC", |
@@ -188,3 +188,3 @@ import { EventEmitter } from "events"; | ||
* Determines whether an entity is managed by this session. | ||
* @param entity The entity to check. | ||
* @param obj The entity to check. | ||
*/ | ||
@@ -191,0 +191,0 @@ contains(obj: any): boolean; |
@@ -53,11 +53,23 @@ "use strict"; | ||
SessionImpl.prototype.save = function (obj, callback) { | ||
if (typeof obj !== "object") { | ||
throw new Error("'obj' argument should be an object."); | ||
} | ||
this._queue.add(1 /* Save */, 4095 /* All */ & ~(1 /* Save */ | 384 /* ReadOnly */), obj, callback); | ||
}; | ||
SessionImpl.prototype.remove = function (obj, callback) { | ||
if (typeof obj !== "object") { | ||
throw new Error("'obj' argument should be an object."); | ||
} | ||
this._queue.add(2 /* Remove */, 4095 /* All */ & ~2 /* Remove */, obj, callback); | ||
}; | ||
SessionImpl.prototype.refresh = function (obj, callback) { | ||
if (typeof obj !== "object") { | ||
throw new Error("'obj' argument should be an object."); | ||
} | ||
this._queue.add(32 /* Refresh */, 4095 /* All */ & ~32 /* Refresh */, obj, callback); | ||
}; | ||
SessionImpl.prototype.detach = function (obj, callback) { | ||
if (typeof obj !== "object") { | ||
throw new Error("'obj' argument should be an object."); | ||
} | ||
this._queue.add(4 /* Detach */, 4095 /* All */ & ~4 /* Detach */, obj, callback); | ||
@@ -129,5 +141,8 @@ }; | ||
* Determines whether an entity is managed by this session. | ||
* @param entity The entity to check. | ||
* @param obj The entity to check. | ||
*/ | ||
SessionImpl.prototype.contains = function (obj) { | ||
if (typeof obj !== "object") { | ||
throw new Error("'obj' argument should be an object."); | ||
} | ||
var id = obj["id"]; | ||
@@ -177,2 +192,5 @@ if (id) { | ||
SessionImpl.prototype.toDocument = function (obj, callback) { | ||
if (typeof obj !== "object") { | ||
throw new Error("'obj' argument should be an object."); | ||
} | ||
var mapping = this.factory.getMappingForObject(obj); | ||
@@ -203,2 +221,5 @@ if (!mapping) { | ||
SessionImpl.prototype.getVersion = function (obj) { | ||
if (typeof obj !== "object") { | ||
throw new Error("'obj' argument should be an object."); | ||
} | ||
var links = this._getObjectLinks(obj); | ||
@@ -205,0 +226,0 @@ if (!links || links.state == 1 /* Detached */) { |
401492
9628