arktype
arktype copied to clipboard
Discriminate based on key presence if keys are strict
Would allow a union like the following to be discriminated:
const discriminated = type({
a: "string",
})
.or({ b: "string" })
.onUndeclaredKey("reject");