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 {
64
64
get state ( ) : number ;
65
65
}
66
66
67
+ /**
68
+ * All options that can be provided to a C++ MongoCrypt constructor.
69
+ */
67
70
export type MongoCryptConstructorOptions = {
68
71
kmsProviders ?: Uint8Array ;
69
72
schemaMap ?: Uint8Array ;
@@ -132,7 +135,7 @@ export type ExplicitEncryptionContextOptions = NonNullable<
132
135
Parameters < IMongoCrypt [ 'makeExplicitEncryptionContext' ] > [ 1 ]
133
136
> ;
134
137
export type DataKeyContextOptions = NonNullable < Parameters < IMongoCrypt [ 'makeDataKeyContext' ] > [ 1 ] > ;
135
- export type MongoCryptOptions = MongoCryptConstructorOptions ;
138
+ export type MongoCryptOptions = Omit < MongoCryptConstructorOptions , 'cryptoCallbacks' > ;
136
139
export type MongoCryptErrorWrapper = MongoCryptOptions [ 'errorWrapper' ] ;
137
140
138
141
// export const
Original file line number Diff line number Diff line change @@ -96,10 +96,7 @@ export class MongoCrypt implements IMongoCrypt {
96
96
constructor ( options : MongoCryptOptions ) {
97
97
// Pass in JS cryptoCallbacks implementation by default.
98
98
// 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 } ) ;
103
100
104
101
this . errorWrapper = options . errorWrapper ;
105
102
You can’t perform that action at this time.
0 commit comments