src/vs/base/common/strings.ts/GraphemeIterator/nextGraphemeLength
class GraphemeIterator:	public nextGraphemeLength(): number {
		const graphemeBreakTree = GraphemeBreakTree.getInstance();
		const iterator = this._iterator;
		const initialOffset = iterator.offset;

		let graphemeBreakType = graphemeBreakTree.getGraphemeBreakType(iterator.nextCodePoint());
		while (!iterator.eol()) {
			const offset = iterator.offset;
			const nextGraphemeBreakType = graphemeBreakTree.getGraphemeBreakType(iterator.nextCodePoint());
			if (breakBetweenGraphemeBreakType(graphemeBreakType, nextGraphemeBreakType)) {
				// move iterator back
				iterator.setOffset(offset);
				break;
			}
			graphemeBreakType = nextGraphemeBreakType;
		}
		return (iterator.offset - initialOffset);
	}