Sha256: d364a8264ed082d00dae41e7d61711b18295c5c082167147c9bd712d63e85363

Contents?: true

Size: 649 Bytes

Versions: 243

Compression:

Stored size: 649 Bytes

Contents

'use strict';

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

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

var SameValue = require('./SameValue');
var ToNumber = require('./ToNumber');
var ToString = require('./ToString');
var Type = require('./Type');

// https://262.ecma-international.org/6.0/#sec-canonicalnumericindexstring

module.exports = function CanonicalNumericIndexString(argument) {
	if (Type(argument) !== 'String') {
		throw new $TypeError('Assertion failed: `argument` must be a String');
	}
	if (argument === '-0') { return -0; }
	var n = ToNumber(argument);
	if (SameValue(ToString(n), argument)) { return n; }
	return void 0;
};

Version data entries

243 entries across 27 versions & 2 rubygems

Version Path
decidim-0.26.8 packages/eslint-config/node_modules/es-abstract/2018/CanonicalNumericIndexString.js
decidim-0.26.8 packages/eslint-config/node_modules/es-abstract/2017/CanonicalNumericIndexString.js
decidim-0.26.8 packages/eslint-config/node_modules/es-abstract/2016/CanonicalNumericIndexString.js