Immutable
Type Aliases
Immutable
Ƭ Immutable<T
>: T
extends ImmutablePrimitive
? T
: T
extends infer U[] ? ImmutableArray
<U
> : T
extends Map
<infer K, infer V> ? ImmutableMap
<K
, V
> : T
extends Set
<infer M> ? ImmutableSet
<M
> : ImmutableObject
<T
>
Helper type to make the given array/map/set/object recursively read-only.
You can use this type to easily build safe data structures.
From: https://stackoverflow.com/questions/41879327/deepreadonly-object-typescript
Type parameters
Name |
---|
T |