Skip to content

Commit 5d7e241

Browse files
fix(uuidhelpers): fix BinData monkey-patching of .base64()
subtype is defined but not base64 for some reason!
1 parent b3cdb05 commit 5d7e241

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

snippets/uuidhelpers/index.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,10 @@ BinData.prototype.toHexUUID = function () {
138138
}
139139

140140
// for compatibility with the new mongosh shell
141-
if (BinData.prototype.base64 === undefined && BinData.prototype.subtype === undefined) {
141+
if (BinData.prototype.base64 === undefined) {
142142
BinData.prototype.base64 = function() { return this.buffer.base64Slice(); };
143+
}
144+
if (BinData.prototype.subtype === undefined) {
143145
BinData.prototype.subtype = function() { return this.sub_type; };
144146
}
145147

0 commit comments

Comments
 (0)