Skip to content

unicode-segmenter@0.17.1

Choose a tag to compare

@github-actions github-actions released this 23 Jul 07:28
5b34af9

Patch Changes

  • e94d203: Add collectGraphemes(input) API that collects grapheme clusters into an array directly.

    This is a fast version of [...splitGraphemes(input)], which is acually the most used pattern in practice.

    It's 2-4x faster than the iterator-based approach. However, it collects all grapheme clusters at once, so it's not good for large text or streamed input.

  • 5fcaa4f: Promote countGraphemes() API to be a fast path.

    It avoids generator overhead and only counts boundaries without allocating segments.
    When only counting, it achieves ~10x faster runtime performance and no GC pressure.