Skip to content
Type

DeepReadonly

Recursively makes all properties of T readonly.

ts
type DeepReadonly<T> = T extends object ? {
	readonly [K in keyof T]: DeepReadonly<T[K]>;
} : T;

Used by

Released under the Mozilla Public License 2.0.