MCPcopy Index your code
hub / github.com/tdewolff/minify / numericToNumber

Function numericToNumber

_benchmarks/sample_echarts.js:7060–7065  ·  view source on GitHub ↗

* [Numberic is defined as]: * `parseFloat(val) == val` * For example: * numeric: * typeof number except NaN, '-123', '123', '2e3', '-2e3', '011', 'Infinity', Infinity, * and they rounded by white-spaces or line-terminal like ' -123 \n ' (see es spec) * not-n

(val)

Source from the content-addressed store, hash-verified

7058 */
7059
7060 function numericToNumber(val) {
7061 var valFloat = parseFloat(val);
7062 return valFloat == val // eslint-disable-line eqeqeq
7063 && (valFloat !== 0 || typeof val !== 'string' || val.indexOf('x') <= 0) // For case ' 0x0 '.
7064 ? valFloat : NaN;
7065 }
7066 /**
7067 * Definition of "numeric": see `numericToNumber`.
7068 */

Callers 6

isNumericFunction · 0.85
makeValueReadableFunction · 0.85
FilterOrderComparatorFunction · 0.85
sample_echarts.jsFile · 0.85
FilterEqualityComparatorFunction · 0.85
makeSeriesScope$2Function · 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…