Sha256: 512ee11742710b515d60b8eb7760bce2e6e2627dee082de3892f349c4b0a269e

Contents?: true

Size: 552 Bytes

Versions: 108

Compression:

Stored size: 552 Bytes

Contents

'use strict';

var GetIntrinsic = require('get-intrinsic');

var $Number = GetIntrinsic('%Number%');

var isPrimitive = require('../helpers/isPrimitive');

var ToPrimitive = require('./ToPrimitive');
var ToNumber = require('./ToNumber');
var Type = require('./Type');

// https://262.ecma-international.org/11.0/#sec-tonumeric

module.exports = function ToNumeric(argument) {
	var primValue = isPrimitive(argument) ? argument : ToPrimitive(argument, $Number);
	if (Type(primValue) === 'BigInt') {
		return primValue;
	}
	return ToNumber(primValue);
};

Version data entries

108 entries across 27 versions & 2 rubygems

Version Path
immosquare-cleaner-0.1.32 node_modules/es-abstract/2023/ToNumeric.js
immosquare-cleaner-0.1.32 node_modules/es-abstract/2020/ToNumeric.js
immosquare-cleaner-0.1.32 node_modules/es-abstract/2021/ToNumeric.js
immosquare-cleaner-0.1.32 node_modules/es-abstract/2022/ToNumeric.js
immosquare-cleaner-0.1.31 node_modules/es-abstract/2022/ToNumeric.js
immosquare-cleaner-0.1.31 node_modules/es-abstract/2020/ToNumeric.js
immosquare-cleaner-0.1.31 node_modules/es-abstract/2021/ToNumeric.js
immosquare-cleaner-0.1.31 node_modules/es-abstract/2023/ToNumeric.js
immosquare-cleaner-0.1.30 node_modules/es-abstract/2022/ToNumeric.js
immosquare-cleaner-0.1.30 node_modules/es-abstract/2020/ToNumeric.js
immosquare-cleaner-0.1.30 node_modules/es-abstract/2021/ToNumeric.js
immosquare-cleaner-0.1.30 node_modules/es-abstract/2023/ToNumeric.js
immosquare-cleaner-0.1.29 node_modules/es-abstract/2020/ToNumeric.js
immosquare-cleaner-0.1.29 node_modules/es-abstract/2021/ToNumeric.js
immosquare-cleaner-0.1.29 node_modules/es-abstract/2022/ToNumeric.js
immosquare-cleaner-0.1.29 node_modules/es-abstract/2023/ToNumeric.js
immosquare-cleaner-0.1.28 node_modules/es-abstract/2020/ToNumeric.js
immosquare-cleaner-0.1.28 node_modules/es-abstract/2021/ToNumeric.js
immosquare-cleaner-0.1.28 node_modules/es-abstract/2022/ToNumeric.js
immosquare-cleaner-0.1.28 node_modules/es-abstract/2023/ToNumeric.js