File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -64,6 +64,9 @@ export interface IMongoCryptContext {
6464 get state ( ) : number ;
6565}
6666
67+ /**
68+ * All options that can be provided to a C++ MongoCrypt constructor.
69+ */
6770export type MongoCryptConstructorOptions = {
6871 kmsProviders ?: Uint8Array ;
6972 schemaMap ?: Uint8Array ;
@@ -132,7 +135,7 @@ export type ExplicitEncryptionContextOptions = NonNullable<
132135 Parameters < IMongoCrypt [ 'makeExplicitEncryptionContext' ] > [ 1 ]
133136> ;
134137export type DataKeyContextOptions = NonNullable < Parameters < IMongoCrypt [ 'makeDataKeyContext' ] > [ 1 ] > ;
135- export type MongoCryptOptions = MongoCryptConstructorOptions ;
138+ export type MongoCryptOptions = Omit < MongoCryptConstructorOptions , 'cryptoCallbacks' > ;
136139export type MongoCryptErrorWrapper = MongoCryptOptions [ 'errorWrapper' ] ;
137140
138141// export const
Original file line number Diff line number Diff line change @@ -96,10 +96,7 @@ export class MongoCrypt implements IMongoCrypt {
9696 constructor ( options : MongoCryptOptions ) {
9797 // Pass in JS cryptoCallbacks implementation by default.
9898 // If the Node.js openssl version is supported this will be ignored.
99- this . mc = new mc . MongoCrypt (
100- // @ts -expect-error: intentionally passing in an argument that will throw to preserve existing behavior
101- options == null || typeof options !== 'object' ? undefined : { cryptoCallbacks, ...options }
102- ) ;
99+ this . mc = new mc . MongoCrypt ( { cryptoCallbacks, ...options } ) ;
103100
104101 this . errorWrapper = options . errorWrapper ;
105102
You can’t perform that action at this time.
0 commit comments