Sha256: 1c1f43278c192690378da7861c10b4e4d673357ebe06782cafaeff26b0aab693
Contents?: true
Size: 786 Bytes
Versions: 4
Compression:
Stored size: 786 Bytes
Contents
'use strict'; // TODO: Remove from `core-js@4` var $ = require('../internals/export'); var charAt = require('../internals/string-multibyte').charAt; var requireObjectCoercible = require('../internals/require-object-coercible'); var toIntegerOrInfinity = require('../internals/to-integer-or-infinity'); var toString = require('../internals/to-string'); // `String.prototype.at` method // https://github.com/mathiasbynens/String.prototype.at $({ target: 'String', proto: true, forced: true }, { at: function at(index) { var S = toString(requireObjectCoercible(this)); var len = S.length; var relativeIndex = toIntegerOrInfinity(index); var k = relativeIndex >= 0 ? relativeIndex : len + relativeIndex; return (k < 0 || k >= len) ? undefined : charAt(S, k); } });
Version data entries
4 entries across 4 versions & 1 rubygems