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

feat(utils): Add isNaN function #4759

Merged
merged 1 commit into from
Mar 23, 2022
Merged

Conversation

lobsterkatie
Copy link
Member

@lobsterkatie lobsterkatie commented Mar 23, 2022

This adds a function, isNaN, to our is module. While it's true that there is a built-in function of the same name, it assumes it's being passed a number (which messes up types), whereas the function introduced here makes no such assumptions.

(This change was extracted from an upcoming PR, to reduce noise there.)

@github-actions
Copy link
Contributor

size-limit report

Path Base Size (1379591) Current Size Change
@sentry/browser - ES5 CDN Bundle (gzipped + minified) 19.49 KB 19.49 KB -0.02% 🔽
@sentry/browser - ES5 CDN Bundle (minified) 62.17 KB 62.17 KB 0%
@sentry/browser - ES6 CDN Bundle (gzipped + minified) 18.12 KB 18.11 KB -0.02% 🔽
@sentry/browser - ES6 CDN Bundle (minified) 55.5 KB 55.5 KB 0%
@sentry/browser - Webpack (gzipped + minified) 22.6 KB 22.6 KB 0%
@sentry/browser - Webpack (minified) 79.21 KB 79.21 KB 0%
@sentry/react - Webpack (gzipped + minified) 22.63 KB 22.63 KB 0%
@sentry/nextjs Client - Webpack (gzipped + minified) 47.6 KB 47.6 KB 0%
@sentry/browser + @sentry/tracing - ES5 CDN Bundle (gzipped + minified) 25.37 KB 25.36 KB -0.01% 🔽
@sentry/browser + @sentry/tracing - ES6 CDN Bundle (gzipped + minified) 23.72 KB 23.72 KB -0.01% 🔽

Copy link
Member

@Lms24 Lms24 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice TIL about the inequality of NaN to NaN (which totally makes sense after reading up on it). Looks good to me + nice test. My only question is, do we currently need this function somewhere or is it there to be used eventually? I get why it makes sense use this function over the built-in isNaN, just asking b/c I don't see it being used at this point.

@lobsterkatie
Copy link
Member Author

My only question is, do we currently need this function somewhere or is it there to be used eventually?

Yup, sorry - have added a note to the PR description.

@lobsterkatie lobsterkatie merged commit 1852e6b into master Mar 23, 2022
@lobsterkatie lobsterkatie deleted the kmclb-add-isNaN-function branch March 23, 2022 17:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants