arktype
arktype copied to clipboard
Spread syntax for merging object literals
Would allow objects to be flexibly merged in an object literal definition like this:
const types = scope({
user: {
isAdmin: "false",
name: "string"
},
admin: {
"...": "user",
"isAdmin": "true"
}
})
For now one per object definition (enforced by the uniqueness of the "..." key) since mapped type key ordering isn't guaranteed to be preserved.