I can restrict the input validity to be a number
but can I translate a string
containing a number
to an actual number
?
type ToNumber <S extends string> = S extends `${number}`
? S // Change this ?
: never
type test = ToNumber <'123'> // is they're a way to get 123 instead of '123'