isFinite.js.flow 386 B

1234567891011121314
  1. // @flow strict
  2. declare function isFinitePolyfill(
  3. value: mixed,
  4. ): boolean %checks(typeof value === 'number');
  5. /* eslint-disable no-redeclare */
  6. // $FlowFixMe workaround for: https://github.com/facebook/flow/issues/4441
  7. const isFinitePolyfill =
  8. Number.isFinite ||
  9. function(value) {
  10. return typeof value === 'number' && isFinite(value);
  11. };
  12. export default isFinitePolyfill;