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.
@@ -4596,7 +4596,7 @@ var BSON = (function (exports) {
4596
4596
  this[kId] = buffer_1.from(workingId, 'hex');
4597
4597
  }
4598
4598
  else {
4599
- throw new BSONTypeError('Argument passed in must be a string of 12 bytes or a string of 24 hex characters');
4599
+ throw new BSONTypeError('Argument passed in must be a string of 12 bytes or a string of 24 hex characters or an integer');
4600
4600
  }
4601
4601
  }
4602
4602
  else {
@@ -4713,7 +4713,7 @@ var BSON = (function (exports) {
4713
4713
  return false;
4714
4714
  }
4715
4715
  if (otherId instanceof ObjectId) {
4716
- return this.toString() === otherId.toString();
4716
+ return this[kId][11] === otherId[kId][11] && this[kId].equals(otherId[kId]);
4717
4717
  }
4718
4718
  if (typeof otherId === 'string' &&
4719
4719
  ObjectId.isValid(otherId) &&
@@ -4730,7 +4730,9 @@ var BSON = (function (exports) {
4730
4730
  if (typeof otherId === 'object' &&
4731
4731
  'toHexString' in otherId &&
4732
4732
  typeof otherId.toHexString === 'function') {
4733
- return otherId.toHexString() === this.toHexString();
4733
+ var otherIdString = otherId.toHexString();
4734
+ var thisIdString = this.toHexString().toLowerCase();
4735
+ return typeof otherIdString === 'string' && otherIdString.toLowerCase() === thisIdString;
4734
4736
  }
4735
4737
  return false;
4736
4738
  };