Skip to content

Commit b010fa9

Browse files
committed
chore: preserve old option passing behavior
1 parent a5cd1e8 commit b010fa9

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/index.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,10 @@ export const MongoCrypt: MongoCryptConstructor = class MongoCrypt extends mc.Mon
107107
constructor(options: MongoCryptConstructorOptions) {
108108
// Pass in JS cryptoCallbacks implementation by default.
109109
// If the Node.js openssl version is supported this will be ignored.
110-
super({ cryptoCallbacks, ...options });
110+
super(
111+
// @ts-expect-error: intentionally passing in an argument that will throw to preserve existing behavior
112+
options == null || typeof options !== 'object' ? undefined : { cryptoCallbacks, ...options }
113+
);
111114
}
112115
};
113116

0 commit comments

Comments
 (0)