isNumeric.js 501 B

123456789101112
  1. "use strict";
  2. var isArray_1 = require('../util/isArray');
  3. 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_1.isArray(val) && (val - parseFloat(val) + 1) >= 0;
  9. }
  10. exports.isNumeric = isNumeric;
  11. ;
  12. //# sourceMappingURL=isNumeric.js.map