thisNumberValue.js 355 B

12345678910111213141516
  1. 'use strict';
  2. var callBound = require('call-bind/callBound');
  3. var $NumberValueOf = callBound('Number.prototype.valueOf');
  4. // https://262.ecma-international.org/6.0/#sec-properties-of-the-number-prototype-object
  5. module.exports = function thisNumberValue(value) {
  6. if (typeof value === 'number') {
  7. return value;
  8. }
  9. return $NumberValueOf(value);
  10. };