MCPcopy Create free account
hub / github.com/play-co/devkit / tryParseNumber

Function tryParseNumber

src/util/obj.js:87–94  ·  view source on GitHub ↗

* Tries to read a number value out of a string, if it fails to match the * entire string, returns the original string instead

(str)

Source from the content-addressed store, hash-verified

85 * entire string, returns the original string instead
86 */
87function tryParseNumber(str) {
88 var num = parseFloat(str);
89 if (num == str) {
90 return num;
91 }
92
93 return str;
94}
95
96/**
97 * Tries to read an integer value out of a string, if it fails to match the

Callers 1

parseKeyFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…