Skip to content
New issue

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

fix: toInt and toFloat symbol input #67

Merged
merged 3 commits into from
Jul 3, 2024
Merged

fix: toInt and toFloat symbol input #67

merged 3 commits into from
Jul 3, 2024

Conversation

aleclarson
Copy link
Member

  • fix(toInt): avoid throwing on symbol input
  • fix(toFloat): avoid throwing on symbol input
  • chore: simplify tests

Tip

The owner of this PR can publish a preview release by commenting /publish in this PR. Afterwards, anyone can try it out by running pnpm add radashi@pr<PR_NUMBER>.

Summary

Both toInt and toFloat should handle any possible input, including symbols. They were throwing on symbols, so I've fixed it. I've also cleaned up the implementations beyond that. I'm also using TypeScript overload syntax to prevent a weird return type of number | number and it now allows any value type to be the default value.

Related issue, if any:

For any code change,

  • Related documentation has been updated, if needed
  • Related tests have been added or updated, if needed
  • Related benchmarks have been added or updated, if needed

Does this PR introduce a breaking change?

No

@aleclarson aleclarson added the upstream fix Fixes a bug that existed in Radash label Jul 3, 2024
@aleclarson aleclarson merged commit 5226220 into main Jul 3, 2024
4 checks passed
@aleclarson aleclarson deleted the fix/toInt-symbol branch July 3, 2024 19:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
upstream fix Fixes a bug that existed in Radash
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants