src/core/grapheme-splitter.js
// Returns the number of grapheme clusters there are in the given string
Returns the number of grapheme clusters there are in the given string
Returns the number of grapheme clusters there are in the given string
function countGraphemes(str) {
    let count = 0;
    let index = 0;
    let brk;
    while ((brk = nextBreak(str, index)) < str.length) {
        index = brk;
        count++;
    }
    if (index < str.length) {
        count++;
    }
    return count;
}
function countGraphemes ( str ) { let count = 0 ; let index = 0 ; let brk ; while ( ( brk = nextBreak ( str , index ) ) < str . length ) { index = brk ; count ++ ; } if ( index < str . length ) { count ++ ; } return count ; }
Returns the number of grapheme clusters there are in the given string
Returns the number of grapheme clusters there are in the given string