From 8f522a581b9d70e4a8100f9f8befc29268029159 Mon Sep 17 00:00:00 2001 From: Matthieu Sieben Date: Fri, 15 Dec 2023 22:17:21 +0100 Subject: [PATCH] wip --- packages/oauth-server/src/util/object.ts | 20 -------------------- 1 file changed, 20 deletions(-) delete mode 100644 packages/oauth-server/src/util/object.ts diff --git a/packages/oauth-server/src/util/object.ts b/packages/oauth-server/src/util/object.ts deleted file mode 100644 index f8c87c241c7..00000000000 --- a/packages/oauth-server/src/util/object.ts +++ /dev/null @@ -1,20 +0,0 @@ -export type DeepReadonly = T extends [infer A, ...infer B] - ? readonly [DeepReadonly, ...DeepReadonly] - : T extends Array - ? ReadonlyArray> - : T extends object - ? { readonly [P in keyof T]: DeepReadonly } - : T - -export function deepFreeze(input: T): DeepReadonly { - if (input != null && typeof input === 'object') { - Object.freeze(input) - for (const prop of Object.getOwnPropertyNames(input)) { - const value = input[prop] - if (value != null && typeof value === 'object') { - deepFreeze(value) - } - } - } - return input as DeepReadonly -}