biobulkbende.org/node_modules/rxjs/_esm2015/util/isNumeric.js

10 lines
452 B
JavaScript
Raw Normal View History

2020-09-16 12:23:28 +00:00
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