Type Alias: Mutable<T>
Mutable<
T> = { -readonly [P in keyof T]: T[P] extends unknown[] | object ? Mutable<T[P]> : T[P] }
Defined in: types.ts:200
Transforms a readonly type to be mutable
Type Parameters
| Type Parameter |
|---|
T |
Example
interface Sample {
id: string;
hobbies: readonly string[];
}
type BB = Mutable<Sample>;
// Expected:
// {
// id: string;
// hobbies: string[];
// }