Comparing version 0.4.22 to 0.4.23
@@ -30,3 +30,4 @@ /** | ||
if(!(this instanceof ObjectID)) return new ObjectID(id); | ||
if((id instanceof ObjectID)) return id; | ||
// Duck-typing to support ObjectId from different npm packages | ||
if((id instanceof ObjectID) || (id && id.toHexString)) return id; | ||
@@ -258,2 +259,6 @@ this._bsontype = 'ObjectID'; | ||
} | ||
// Duck-Typing detection of ObjectId like objects | ||
if(id.toHexString) { | ||
return id.id.length == 12 || (id.id.length == 24 && checkForHexRegExp.test(id.id)); | ||
} | ||
return false; | ||
@@ -260,0 +265,0 @@ }; |
{ "name" : "bson" | ||
, "description" : "A bson parser for node.js and the browser" | ||
, "keywords" : ["mongodb", "bson", "parser"] | ||
, "version" : "0.4.22" | ||
, "version" : "0.4.23" | ||
, "author" : "Christian Amor Kvalheim <christkv@gmail.com>" | ||
@@ -15,3 +15,2 @@ , "contributors" : [] | ||
, "gleak": "0.2.3" | ||
, "one": "2.X.X" | ||
, "benchmark": "1.0.0" | ||
@@ -18,0 +17,0 @@ , "colors": "1.1.0" |
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
435674
4
11361