UNPKG

316 BJavaScriptView Raw
1var classof = require('../internals/classof-raw');
2
3// `thisNumberValue` abstract operation
4// https://tc39.github.io/ecma262/#sec-thisnumbervalue
5module.exports = function (value) {
6 if (typeof value != 'number' && classof(value) != 'Number') {
7 throw TypeError('Incorrect invocation');
8 }
9 return +value;
10};