Last active
March 8, 2020 22:46
-
-
Save colinhacks/c3abb7ede2e1b6a7c539a57a62f88cbf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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