arktype icon indicating copy to clipboard operation
arktype copied to clipboard

Discriminate based on key presence if keys are strict

Open ssalbdivad opened this issue 1 year ago • 0 comments

Would allow a union like the following to be discriminated:

const discriminated = type({
  a: "string",
})
  .or({ b: "string" })
  .onUndeclaredKey("reject");

ssalbdivad avatar Jun 06 '23 20:06 ssalbdivad