umd/fieldstack.js
/**
 * Convert to native JavaScript string lengths to determine ranges.
 */
Convert to native JavaScript string lengths to determine ranges.
Convert to native JavaScript string lengths to determine ranges .
function decodeEntityRanges(text, ranges) {
  var entities = Array(text.length).fill(null);
  if (ranges) {
    ranges.forEach(function (range) {
      var start = substr$1(text, 0, range.offset).length;
      var end = start + substr$1(text, range.offset, range.length).length;
      for (var ii = start; ii < end; ii++) {
        entities[ii] = range.key;
      }
    });
  }
  return entities;
}
function decodeEntityRanges ( text , ranges ) { var entities = Array ( text . length ) . fill ( null ) ; if ( ranges ) { ranges . forEach ( function ( range ) { var start = substr$1 ( text , 0 , range . offset ) . length ; var end = start + substr$1 ( text , range . offset , range . length ) . length ; for ( var ii = start ; ii < end ; ii ++ ) { entities [ ii ] = range . key ; } } ) ; } return entities ; }
Convert to native JavaScript string lengths to determine ranges.
Convert to native JavaScript string lengths to determine ranges .
// Using Unicode-enabled substrings converted to JavaScript lengths, // fill the output array with entity keys.