From b010fa9b8f780226afe288b6ce1e7a3582c95e19 Mon Sep 17 00:00:00 2001 From: Neal Beeken Date: Tue, 9 Jul 2024 15:26:53 -0400 Subject: [PATCH] chore: preserve old option passing behavior --- src/index.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index 717b220..44a027b 100644 --- a/src/index.ts +++ b/src/index.ts @@ -107,7 +107,10 @@ export const MongoCrypt: MongoCryptConstructor = class MongoCrypt extends mc.Mon constructor(options: MongoCryptConstructorOptions) { // Pass in JS cryptoCallbacks implementation by default. // If the Node.js openssl version is supported this will be ignored. - super({ cryptoCallbacks, ...options }); + super( + // @ts-expect-error: intentionally passing in an argument that will throw to preserve existing behavior + options == null || typeof options !== 'object' ? undefined : { cryptoCallbacks, ...options } + ); } };