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

Function tryParseInt

src/util/obj.js:100–107  ·  view source on GitHub ↗

* Tries to read an integer 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

98 * entire string, returns the original string instead
99 */
100function tryParseInt(str) {
101 var num = parseInt(str);
102 if (num == str) {
103 return num;
104 }
105
106 return str;
107}
108
109/**
110 * Parses a string key of the form "foo.bar[a=1, b=2].baz[alpha = beta].delta"

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…