Skip to content

Commit 7e65ad5

Browse files
refactor(util/index): Remove isnumeric as a dependency.
1 parent c008549 commit 7e65ad5

File tree

3 files changed

+1
-11
lines changed

3 files changed

+1
-11
lines changed

lib/util/index.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
* General Transitive utilities library
33
*/
44

5-
import isNumeric from 'isnumeric/isNumeric'
65
import SphericalMercator from 'sphericalmercator'
76

87
const TOLERANCE = 0.000001
@@ -199,7 +198,7 @@ const sm = new SphericalMercator()
199198
* @returns A CSS font size ending with the provided CSS unit or 'px' if none provided.
200199
*/
201200
function getFontSizeWithUnit (fontSize) {
202-
return fontSize + (isNumeric(fontSize) ? 'px' : '')
201+
return fontSize + (isFinite(fontSize) ? 'px' : '')
203202
}
204203

205204
export {

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
"component-emitter": "1.2.1",
2020
"d3": "^3.5.8",
2121
"debug": "^2.5.1",
22-
"isnumeric": "^0.2.0",
2322
"lodash.foreach": "^4.5.0",
2423
"measure-text": "^0.0.4",
2524
"priorityqueuejs": "1.0.0",

yarn.lock

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14871,7 +14871,6 @@ npm@^6.14.8:
1487114871
cmd-shim "^3.0.3"
1487214872
columnify "~1.5.4"
1487314873
config-chain "^1.1.12"
14874-
debuglog "*"
1487514874
detect-indent "~5.0.0"
1487614875
detect-newline "^2.1.0"
1487714876
dezalgo "~1.0.3"
@@ -14886,7 +14885,6 @@ npm@^6.14.8:
1488614885
has-unicode "~2.0.1"
1488714886
hosted-git-info "^2.8.8"
1488814887
iferr "^1.0.2"
14889-
imurmurhash "*"
1489014888
infer-owner "^1.0.4"
1489114889
inflight "~1.0.6"
1489214890
inherits "^2.0.4"
@@ -14905,14 +14903,8 @@ npm@^6.14.8:
1490514903
libnpx "^10.2.4"
1490614904
lock-verify "^2.1.0"
1490714905
lockfile "^1.0.4"
14908-
lodash._baseindexof "*"
1490914906
lodash._baseuniq "~4.6.0"
14910-
lodash._bindcallback "*"
14911-
lodash._cacheindexof "*"
14912-
lodash._createcache "*"
14913-
lodash._getnative "*"
1491414907
lodash.clonedeep "~4.5.0"
14915-
lodash.restparam "*"
1491614908
lodash.union "~4.6.0"
1491714909
lodash.uniq "~4.5.0"
1491814910
lodash.without "~4.4.0"

0 commit comments

Comments
 (0)