bson 4.6.3 → 4.6.4

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 CHANGED
@@ -22,5 +22,5 @@
22
22
  "test",
23
23
  "tools"
24
24
  ],
25
- "version": "4.6.3"
25
+ "version": "4.6.4"
26
26
  }
@@ -4587,7 +4587,8 @@ var ObjectId = /** @class */ (function () {
4587
4587
  this[kId] = ObjectId.generate(typeof workingId === 'number' ? workingId : undefined);
4588
4588
  }
4589
4589
  else if (ArrayBuffer.isView(workingId) && workingId.byteLength === 12) {
4590
- this[kId] = ensureBuffer(workingId);
4590
+ // If intstanceof matches we can escape calling ensure buffer in Node.js environments
4591
+ this[kId] = workingId instanceof buffer_1 ? workingId : ensureBuffer(workingId);
4591
4592
  }
4592
4593
  else if (typeof workingId === 'string') {
4593
4594
  if (workingId.length === 12) {