Recursively removes the readonly modifier from all properties of an object, array, Map, or Set. Primitives and functions are returned as is.
readonly
The type to make deeply mutable.
A new type with all nested readonly modifiers removed.
type ReadonlyData = { readonly a: number; readonly b: { readonly c: readonly string[] } };type MutableData = DeepMutable<ReadonlyData>;// Result: { a: number; b: { c: string[] } } Copy
type ReadonlyData = { readonly a: number; readonly b: { readonly c: readonly string[] } };type MutableData = DeepMutable<ReadonlyData>;// Result: { a: number; b: { c: string[] } }
Recursively removes the
readonlymodifier from all properties of an object, array, Map, or Set. Primitives and functions are returned as is.