A tool for [converting][convert] a sorted series of JavaScript string character offsets in a [text] to code-point offsets.

Constructors

Properties

Methods

Constructors

Properties

text: string

Methods

  • Converts a JavaScript string char-based offset in [text] to a codepoint offset.

    Parameters

    • charOffset: number

      The offset in JavaScript string characters.

    Returns number

    RangeError if the [charOffset] is out of bounds of [text], or when its value in this call is smaller than in the previous call.