You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

12 lines
262 B

1 month ago
  1. 'use strict';
  2. var $isNaN = require('./isNaN');
  3. /** @type {import('./isFinite')} */
  4. module.exports = function isFinite(x) {
  5. return (typeof x === 'number' || typeof x === 'bigint')
  6. && !$isNaN(x)
  7. && x !== Infinity
  8. && x !== -Infinity;
  9. };