_advance-string-index.js 262 B

12345678
  1. 'use strict';
  2. var at = require('./_string-at')(true);
  3. // `AdvanceStringIndex` abstract operation
  4. // https://tc39.github.io/ecma262/#sec-advancestringindex
  5. module.exports = function (S, index, unicode) {
  6. return index + (unicode ? at(S, index).length : 1);
  7. };