isNumeric.js 512B

123456789101112
  1. /** PURE_IMPORTS_START .._util_isArray PURE_IMPORTS_END */
  2. import { isArray } from '../util/isArray';
  3. export function isNumeric(val) {
  4. // parseFloat NaNs numeric-cast false positives (null|true|false|"")
  5. // ...but misinterprets leading-number strings, particularly hex literals ("0x...")
  6. // subtraction forces infinities to NaN
  7. // adding 1 corrects loss of precision from parseFloat (#15100)
  8. return !isArray(val) && (val - parseFloat(val) + 1) >= 0;
  9. }
  10. ;
  11. //# sourceMappingURL=isNumeric.js.map