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
The following seems to work for enforcing a float constrain on a number:
type Float<T extends number> = `${T}` extends `${bigint}` ? never : T; const onlyFloat = <T extends number> ( x: Float<T> ): void => {} onlyFloat ( 123 ); // Error onlyFloat ( 123.123 ); // OK
It's basically just Integer but with the results flipped.
The text was updated successfully, but these errors were encountered:
// @jonahsnider
Sorry, something went wrong.
Float
Successfully merging a pull request may close this issue.
The following seems to work for enforcing a float constrain on a number:
It's basically just Integer but with the results flipped.
The text was updated successfully, but these errors were encountered: