Skip to content

Commit

Permalink
chore: preserve old option passing behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
nbbeeken committed Jul 9, 2024
1 parent a5cd1e8 commit b010fa9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
);
}
};

Expand Down

0 comments on commit b010fa9

Please sign in to comment.