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(isNumber)!: return true for NaN values #248

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

MarlonPassos-git
Copy link
Contributor

@MarlonPassos-git MarlonPassos-git commented Sep 16, 2024

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

This PR updates the isNumber function to return true for NaN values, Resolve #74

Related issue, if any:

sodiray/radash#405
https://github.com/orgs/radashi-org/discussions/74

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?

Yes

Bundle impact

Status File Size 1 Difference
M src/typed/isNumber.ts 63 -18 (-22%)

Footnotes

  1. Function size includes the import dependencies of the function.

@MarlonPassos-git MarlonPassos-git added BREAKING CHANGE Not backwards compatible upstream fix Fixes a bug that existed in Radash labels Sep 16, 2024
@radashi-bot
Copy link

radashi-bot commented Sep 16, 2024

Benchmark Results

Name Current Baseline Change
isFloat ▶︎ with non-number value 3,537,434.79 ops/sec ±0.58% 4,293,680.39 ops/sec ±0.07% 🔗 🐢 -17.61%
isFloat ▶︎ with integer 2,237,762.19 ops/sec ±0.06% 4,131,841.35 ops/sec ±0.06% 🔗 🐢 -45.84%
isFloat ▶︎ with float 2,235,520.67 ops/sec ±0.05% 3,995,665.72 ops/sec ±0.07% 🔗 🐢 -44.05%
isNumber ▶︎ with null 4,050,090.9 ops/sec ±0.09% 5,110,241.33 ops/sec ±0.33% 🔗 🐢 -20.75%
isNumber ▶︎ with integer 4,341,285.61 ops/sec ±0.06% 2,708,845.48 ops/sec ±0.07% 🔗 🚀 +60.26%
isNumber ▶︎ with float 4,556,382.9 ops/sec ±0.11% 2,709,111.28 ops/sec ±0.06% 🔗 🚀 +68.19%
isNumber ▶︎ with non-number 4,455,833.15 ops/sec ±0.07% 5,166,013.93 ops/sec ±0.14% 🔗 🐢 -13.75%

Performance regressions of 30% or more should be investigated, unless they were anticipated. Smaller regressions may be due to normal variability, as we don't use dedicated CI infrastructure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BREAKING CHANGE Not backwards compatible upstream fix Fixes a bug that existed in Radash
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants