ts-deep-readonly
v0.0.5
Published
DeepReadonly type
Downloads
52
Readme
ts-deep-readonly
DeepReadonly type
Getting started
npm i ts-deep-readonly
Description
export type DeepReadonly<T> = T extends (...args: never[]) => unknown
? T
: T extends Map<infer K, infer V>
? ReadonlyMap<DeepReadonly<K>, DeepReadonly<V>>
: T extends Set<infer V>
? ReadonlySet<DeepReadonly<V>>
: { readonly [P in keyof T]: DeepReadonly<T[P]> }