mirror of
https://github.com/biobulkbende/biobulkbende.org.git
synced 2024-12-27 05:15:25 +00:00
10 lines
452 B
JavaScript
10 lines
452 B
JavaScript
import { isArray } from '../util/isArray';
|
|
export function isNumeric(val) {
|
|
// parseFloat NaNs numeric-cast false positives (null|true|false|"")
|
|
// ...but misinterprets leading-number strings, particularly hex literals ("0x...")
|
|
// subtraction forces infinities to NaN
|
|
// adding 1 corrects loss of precision from parseFloat (#15100)
|
|
return !isArray(val) && (val - parseFloat(val) + 1) >= 0;
|
|
}
|
|
;
|
|
//# sourceMappingURL=isNumeric.js.map
|