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 -}