TypeScript/tests/cases/conformance/types/rest/objectRestReadonly.ts
Nathan Shively-Sanders 3631af6486
Remove readonly from object rest properties (#23746)
* Remove readonly from object rest properties

Works the same as removing it from object spread properties

* Fix bug number in test
2018-04-27 14:54:59 -07:00

16 lines
199 B
TypeScript

// #23734
type ObjType = {
foo: string
baz: string
quux: string
}
const obj: Readonly<ObjType> = {
foo: 'bar',
baz: 'qux',
quux: 'quuz',
}
const { foo, ...rest } = obj
delete rest.baz