ensure-finite-number.js 296 B

123456789
  1. "use strict";
  2. var isFiniteNumber = require("./is-finite-number")
  3. , safeToString = require("../safe-to-string");
  4. module.exports = function (value) {
  5. if (isFiniteNumber(value)) return Number(value);
  6. throw new TypeError(safeToString(value) + " does not represent a finite number value");
  7. };