mirror of
https://github.com/JasonYANG170/IOTConnect-Web.git
synced 2024-11-23 20:26:28 +00:00
10 lines
296 B
JavaScript
10 lines
296 B
JavaScript
|
"use strict";
|
||
|
|
||
|
var isFiniteNumber = require("./is-finite-number")
|
||
|
, safeToString = require("../safe-to-string");
|
||
|
|
||
|
module.exports = function (value) {
|
||
|
if (isFiniteNumber(value)) return Number(value);
|
||
|
throw new TypeError(safeToString(value) + " does not represent a finite number value");
|
||
|
};
|