source: imaps-frontend/node_modules/es-abstract/2020/ToNumeric.js

main
Last change on this file was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago

Update repo after prototype presentation

  • Property mode set to 100644
File size: 523 bytes
Line 
1'use strict';
2
3var GetIntrinsic = require('get-intrinsic');
4
5var $Number = GetIntrinsic('%Number%');
6
7var isPrimitive = require('../helpers/isPrimitive');
8
9var ToPrimitive = require('./ToPrimitive');
10var ToNumber = require('./ToNumber');
11
12// https://262.ecma-international.org/11.0/#sec-tonumeric
13
14module.exports = function ToNumeric(argument) {
15 var primValue = isPrimitive(argument) ? argument : ToPrimitive(argument, $Number);
16 if (typeof primValue === 'bigint') {
17 return primValue;
18 }
19 return ToNumber(primValue);
20};
Note: See TracBrowser for help on using the repository browser.