Skip to content
This repository was archived by the owner on Jul 9, 2024. It is now read-only.

Commit 8464a86

Browse files
authored
fix: add create UUID when no value (#155)
1 parent c42e0bf commit 8464a86

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/scope.ts

+3
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ const SCOPE: { [x: string]: Function } = {
1717
return new bson.Binary(Buffer.from(d, 'base64'), t);
1818
},
1919
UUID: function(u: any) {
20+
if (u === undefined) {
21+
return new bson.UUID().toBinary();
22+
}
2023
return new bson.Binary(Buffer.from(u.replace(/-/g, ''), 'hex'), 4);
2124
},
2225
Code: function(c: any, s: any) {

0 commit comments

Comments
 (0)