Skip to content

Commit f3b05ff

Browse files
committed
Make the type readonly
1 parent 8474302 commit f3b05ff

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

src/gdpr/types.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,12 @@ import type { ReactNode } from "react";
44
//See: test/types/gdpr.ts to understand theses types
55

66
export type FinalityConsent<Finality extends string> = {
7-
[K in Finality as K extends `${infer _P}.${infer _C}` ? never : K]: boolean;
7+
readonly [K in Finality as K extends `${infer _P}.${infer _C}` ? never : K]: boolean;
88
} & {
9-
[K in Finality as K extends `${infer P}.${infer _C}` ? P : never]: Record<
10-
K extends `${infer _P}.${infer C}` ? C : never,
11-
boolean
12-
> & { isFullConsent: boolean };
13-
} & { isFullConsent: boolean };
9+
readonly [K in Finality as K extends `${infer P}.${infer _C}` ? P : never]: Readonly<
10+
Record<K extends `${infer _P}.${infer C}` ? C : never, boolean>
11+
> & { readonly isFullConsent: boolean };
12+
} & { readonly isFullConsent: boolean };
1413

1514
export type ExtractFinalityFromFinalityDescription<
1615
FinalityDescription extends Record<

0 commit comments

Comments
 (0)