Deeply freeze object

This commit is contained in:
2026-08-10 02:30:55 +00:00
parent a075594683
commit 78311487a4
4 changed files with 94 additions and 7 deletions
+11
View File
@@ -0,0 +1,11 @@
/**
* A deeply readonly type.
* @template T - The type to make deeply readonly.
* @returns The deeply readonly type.
*/
export type DeeplyReadonly<T> = {
readonly [K in keyof T]:
T[K] extends (...args: never[]) => unknown
? T[K]
: DeeplyReadonly<T[K]>;
};