We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
type Num = [1, 2, 3, 4, 5, 6, 7, 8, 9, 0] type FuNum<S> = S extends `-${infer R}` ? R : S type isFu<S> = FuNum<S> extends never ? S : FuNum<S> type isNum<S> = S extends `${infer R}${infer X}` ? (R extends `${Num[number]}` ? (X extends '' ? true : isNum<X>) : false) : never type GetNum<S> = isNum<isFu<S>> extends true ? S : never type A<S, Arr extends any[] = []> = S extends `${Arr['length']}` ? Arr['length'] : A<S, [S, ...Arr]> type ToNumber<S extends string> = A<FuNum<GetNum<S>>> // this's false ( +number To -number , i don't konw HELP ME! ) Expect<Equal<ToNumber<'-27'>, -27>>
The text was updated successfully, but these errors were encountered:
No branches or pull requests
The text was updated successfully, but these errors were encountered: