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

Remove isNumeric util function and use Number.isFinite instead #6106

Merged
merged 2 commits into from Oct 18, 2018

Conversation

kristw
Copy link
Contributor

@kristw kristw commented Oct 15, 2018

The current isNumeric() function checks if the value is not NaN, Infinity nor -Infinity.

  • This function is only used in one file
  • It has unclear name (Infinity and -Infinity are usually considered Number)
  • It can be easily replaced with native function Number.isFinite()
Number.isFinite(Infinity);  // false
Number.isFinite(NaN);       // false
Number.isFinite(-Infinity); // false

Number.isFinite(0);         // true
Number.isFinite(2e64);      // true

Number.isFinite('0');       // false, would've been true with
                            // global isFinite('0')
Number.isFinite(null);      // false, would've been true with
                            // global isFinite(null)

@graceguo-supercat @williaster @conglei @michellethomas

@kristw kristw closed this Oct 15, 2018
@kristw kristw reopened this Oct 15, 2018
@codecov-io
Copy link

Codecov Report

Merging #6106 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #6106   +/-   ##
=======================================
  Coverage   77.28%   77.28%           
=======================================
  Files          47       47           
  Lines        9332     9332           
=======================================
  Hits         7212     7212           
  Misses       2120     2120

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 12ce1b2...4564c9b. Read the comment docs.

Copy link
Contributor

@williaster williaster left a comment

Choose a reason for hiding this comment

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

nice find 🏆 LGTM

@williaster williaster merged commit 0aa6d90 into apache:master Oct 18, 2018
@kristw kristw deleted the kristw-isNumeric branch October 18, 2018 18:33
bipinsoniguavus pushed a commit to ThalesGroup/incubator-superset that referenced this pull request Dec 26, 2018
…e#6106)

* remove isNumeric util function and use lodash isFinite instead

* use native Number.isFinite
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.34.0 labels Feb 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.34.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants