Replies: 1 comment 8 replies
-
Have you tried... const NumberEnum = <T extends number[]>(values: [...T]) => t.Unsafe<T[number]>({
type: 'number', enum: values
}) ![]() |
Beta Was this translation helpful? Give feedback.
8 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi there! I would like to ensure that a parameter is part of a list of numeric values.
I tried something along the lines of:
Which of course only allows numbers in, but produces the correct type at least.
Has anybody done that?
Beta Was this translation helpful? Give feedback.
All reactions