type-fest/test-d/mutable.ts
Tiger Oakes 9a275f6911 Add Mutable type (#26)
Fixes #17 

Co-authored-by: Sindre Sorhus <sindresorhus@gmail.com>
2019-04-19 15:30:28 +07:00

12 lines
190 B
TypeScript

import {Mutable} from '..';
type Foo = {
readonly a: number;
readonly b: string;
};
const ab: Mutable<Foo> = {a: 1, b: '2'};
ab.a = 2;
const ab2: Mutable<Readonly<Foo>> = ab;
ab2.a = 2;