Skip to content

Commit f4a8156

Browse files
author
theo
committed
fix: types
1 parent 999905a commit f4a8156

File tree

2 files changed

+1452
-3
lines changed

2 files changed

+1452
-3
lines changed

src/transformer.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ export class EncryptionTransformer implements ValueTransformer {
5959
export class JSONEncryptionTransformer implements ValueTransformer {
6060
constructor(private options: EncryptionOptions) {}
6161

62-
public from(value?: string | null | object): string | undefined {
62+
public from(value?: string | null | object): Object | undefined {
6363
if (!value) {
6464
return;
6565
}
@@ -72,12 +72,12 @@ export class JSONEncryptionTransformer implements ValueTransformer {
7272
return JSON.parse(decrypted);
7373
}
7474

75-
public to(value?: string | FindOperator<any> | null): string | FindOperator<any> | undefined {
75+
public to(value?: any | FindOperator<any> | null): string | FindOperator<any> | undefined {
7676
if ((value ?? null) === null) {
7777
return;
7878
}
7979

80-
if (typeof value === 'object' && !value.type) {
80+
if (typeof value === 'object' && !value?.type) {
8181
return encryptData(
8282
Buffer.from(JSON.stringify(value) as string, 'utf8'),
8383
this.options

0 commit comments

Comments
 (0)