Skip to content

Instantly share code, notes, and snippets.

@colinhacks
Last active March 8, 2020 22:46
Show Gist options
  • Save colinhacks/c3abb7ede2e1b6a7c539a57a62f88cbf to your computer and use it in GitHub Desktop.
Save colinhacks/c3abb7ede2e1b6a7c539a57a62f88cbf to your computer and use it in GitHub Desktop.
const numList = yup
.array()
.of(yup.string())
.required();
// interpreted as a non-empty list
numList.validateSync([]); // fails
// yet the inferred type doesn't reflect this
type NumList = yup.InferType<typeof numList>;
// returns string[]
// should be [string,...string[]]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment