Comparing version 5.7.2 to 5.7.3
@@ -58,8 +58,4 @@ /// <reference path="../_references.d.ts" /> | ||
function ObjectID(target, name) { | ||
target.constructor.schema = _.clone(target.constructor.schema || {}); | ||
target.constructor.schema[name] = MongoDB.ObjectID; | ||
target.constructor.transforms[name] = { | ||
fromDB: function (value) { return value && value._bsontype == 'ObjectID' ? new MongoDB.ObjectID(value.id).toHexString() : value; }, | ||
toDB: function (value) { return value && typeof value === 'string' ? new MongoDB.ObjectID(value) : value; } | ||
}; | ||
Property(MongoDB.ObjectID)(target, name); | ||
Transform(function (value) { return value && value._bsontype == 'ObjectID' ? new MongoDB.ObjectID(value.id).toHexString() : value; }, function (value) { return value && typeof value === 'string' ? new MongoDB.ObjectID(value) : value; })(target, name); | ||
} | ||
@@ -66,0 +62,0 @@ exports.ObjectID = ObjectID; |
@@ -0,0 +0,0 @@ var _ = require('lodash'); |
@@ -0,0 +0,0 @@ /// <reference path="../_references.d.ts" /> |
@@ -0,0 +0,0 @@ var util = require('util'); |
@@ -63,8 +63,7 @@ /// <reference path="../_references.d.ts" /> | ||
export function ObjectID(target: { constructor: typeof Instance }, name: string) { | ||
target.constructor.schema = <Schema>_.clone(target.constructor.schema || {}); | ||
target.constructor.schema[name] = MongoDB.ObjectID; | ||
target.constructor.transforms[name] = { | ||
fromDB: value => value && value._bsontype == 'ObjectID' ? new MongoDB.ObjectID(value.id).toHexString() : value, | ||
toDB: value => value && typeof value === 'string' ? new MongoDB.ObjectID(value) : value | ||
}; | ||
Property(MongoDB.ObjectID)(target, name); | ||
Transform( | ||
value => value && value._bsontype == 'ObjectID' ? new MongoDB.ObjectID(value.id).toHexString() : value, | ||
value => value && typeof value === 'string' ? new MongoDB.ObjectID(value) : value | ||
)(target, name); | ||
} |
{ | ||
"name": "iridium", | ||
"version": "5.7.2", | ||
"version": "5.7.3", | ||
"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 too big to display
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
1112602
5081