Comparing version 4.6.1 to 4.6.2
@@ -25,3 +25,3 @@ { | ||
], | ||
"version": "4.6.1" | ||
"version": "4.6.2" | ||
} |
@@ -878,3 +878,3 @@ import { Buffer } from 'buffer'; | ||
declare class ObjectId { | ||
_bsontype: 'ObjectId'; | ||
_bsontype: 'ObjectID'; | ||
/* Excluded from this release type: index */ | ||
@@ -881,0 +881,0 @@ static cacheHexString: boolean; |
@@ -65,3 +65,3 @@ "use strict"; | ||
else { | ||
throw new error_1.BSONTypeError('Argument passed in must be a string of 12 bytes or a string of 24 hex characters'); | ||
throw new error_1.BSONTypeError('Argument passed in must be a string of 12 bytes or a string of 24 hex characters or an integer'); | ||
} | ||
@@ -183,3 +183,3 @@ } | ||
if (otherId instanceof ObjectId) { | ||
return this.toString() === otherId.toString(); | ||
return this[kId][11] === otherId[kId][11] && this[kId].equals(otherId[kId]); | ||
} | ||
@@ -201,3 +201,5 @@ if (typeof otherId === 'string' && | ||
typeof otherId.toHexString === 'function') { | ||
return otherId.toHexString() === this.toHexString(); | ||
var otherIdString = otherId.toHexString(); | ||
var thisIdString = this.toHexString().toLowerCase(); | ||
return typeof otherIdString === 'string' && otherIdString.toLowerCase() === thisIdString; | ||
} | ||
@@ -204,0 +206,0 @@ return false; |
@@ -18,3 +18,3 @@ { | ||
"types": "bson.d.ts", | ||
"version": "4.6.1", | ||
"version": "4.6.2", | ||
"author": { | ||
@@ -21,0 +21,0 @@ "name": "The MongoDB NodeJS Team", |
@@ -31,3 +31,3 @@ import { Buffer } from 'buffer'; | ||
export class ObjectId { | ||
_bsontype!: 'ObjectId'; | ||
_bsontype!: 'ObjectID'; | ||
@@ -88,3 +88,3 @@ /** @internal */ | ||
throw new BSONTypeError( | ||
'Argument passed in must be a string of 12 bytes or a string of 24 hex characters' | ||
'Argument passed in must be a string of 12 bytes or a string of 24 hex characters or an integer' | ||
); | ||
@@ -217,3 +217,3 @@ } | ||
if (otherId instanceof ObjectId) { | ||
return this.toString() === otherId.toString(); | ||
return this[kId][11] === otherId[kId][11] && this[kId].equals(otherId[kId]); | ||
} | ||
@@ -243,3 +243,5 @@ | ||
) { | ||
return otherId.toHexString() === this.toHexString(); | ||
const otherIdString = otherId.toHexString(); | ||
const thisIdString = this.toHexString().toLowerCase(); | ||
return typeof otherIdString === 'string' && otherIdString.toLowerCase() === thisIdString; | ||
} | ||
@@ -246,0 +248,0 @@ |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
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
2891516
39687
16