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.esm.js
CHANGED
|
@@ -2562,7 +2562,7 @@ var ObjectId = /** @class */ (function () {
|
|
|
2562
2562
|
this[kId] = Buffer.from(workingId, 'hex');
|
|
2563
2563
|
}
|
|
2564
2564
|
else {
|
|
2565
|
-
throw new BSONTypeError('Argument passed in must be a string of 12 bytes or a string of 24 hex characters');
|
|
2565
|
+
throw new BSONTypeError('Argument passed in must be a string of 12 bytes or a string of 24 hex characters or an integer');
|
|
2566
2566
|
}
|
|
2567
2567
|
}
|
|
2568
2568
|
else {
|
|
@@ -2679,7 +2679,7 @@ var ObjectId = /** @class */ (function () {
|
|
|
2679
2679
|
return false;
|
|
2680
2680
|
}
|
|
2681
2681
|
if (otherId instanceof ObjectId) {
|
|
2682
|
-
return this
|
|
2682
|
+
return this[kId][11] === otherId[kId][11] && this[kId].equals(otherId[kId]);
|
|
2683
2683
|
}
|
|
2684
2684
|
if (typeof otherId === 'string' &&
|
|
2685
2685
|
ObjectId.isValid(otherId) &&
|
|
@@ -2696,7 +2696,9 @@ var ObjectId = /** @class */ (function () {
|
|
|
2696
2696
|
if (typeof otherId === 'object' &&
|
|
2697
2697
|
'toHexString' in otherId &&
|
|
2698
2698
|
typeof otherId.toHexString === 'function') {
|
|
2699
|
-
|
|
2699
|
+
var otherIdString = otherId.toHexString();
|
|
2700
|
+
var thisIdString = this.toHexString().toLowerCase();
|
|
2701
|
+
return typeof otherIdString === 'string' && otherIdString.toLowerCase() === thisIdString;
|
|
2700
2702
|
}
|
|
2701
2703
|
return false;
|
|
2702
2704
|
};
|