bson 4.6.1 → 4.6.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bower.json +1 -1
- package/bson.d.ts +1 -1
- package/dist/bson.browser.esm.js +5 -3
- package/dist/bson.browser.esm.js.map +1 -1
- package/dist/bson.browser.umd.js +5 -3
- package/dist/bson.browser.umd.js.map +1 -1
- package/dist/bson.bundle.js +5 -3
- package/dist/bson.bundle.js.map +1 -1
- package/dist/bson.esm.js +5 -3
- package/dist/bson.esm.js.map +1 -1
- package/lib/objectid.js +5 -3
- package/lib/objectid.js.map +1 -1
- package/package.json +1 -1
- package/src/objectid.ts +6 -4
package/dist/bson.browser.umd.js
CHANGED
|
@@ -4599,7 +4599,7 @@
|
|
|
4599
4599
|
this[kId] = buffer_1.from(workingId, 'hex');
|
|
4600
4600
|
}
|
|
4601
4601
|
else {
|
|
4602
|
-
throw new BSONTypeError('Argument passed in must be a string of 12 bytes or a string of 24 hex characters');
|
|
4602
|
+
throw new BSONTypeError('Argument passed in must be a string of 12 bytes or a string of 24 hex characters or an integer');
|
|
4603
4603
|
}
|
|
4604
4604
|
}
|
|
4605
4605
|
else {
|
|
@@ -4716,7 +4716,7 @@
|
|
|
4716
4716
|
return false;
|
|
4717
4717
|
}
|
|
4718
4718
|
if (otherId instanceof ObjectId) {
|
|
4719
|
-
return this
|
|
4719
|
+
return this[kId][11] === otherId[kId][11] && this[kId].equals(otherId[kId]);
|
|
4720
4720
|
}
|
|
4721
4721
|
if (typeof otherId === 'string' &&
|
|
4722
4722
|
ObjectId.isValid(otherId) &&
|
|
@@ -4733,7 +4733,9 @@
|
|
|
4733
4733
|
if (typeof otherId === 'object' &&
|
|
4734
4734
|
'toHexString' in otherId &&
|
|
4735
4735
|
typeof otherId.toHexString === 'function') {
|
|
4736
|
-
|
|
4736
|
+
var otherIdString = otherId.toHexString();
|
|
4737
|
+
var thisIdString = this.toHexString().toLowerCase();
|
|
4738
|
+
return typeof otherIdString === 'string' && otherIdString.toLowerCase() === thisIdString;
|
|
4737
4739
|
}
|
|
4738
4740
|
return false;
|
|
4739
4741
|
};
|