proposit-core
    Preparing search index...

    Function sliceByCodePoints

    • Slices a string by code-point offsets.

      String.prototype.slice on the same offsets is wrong for any text containing an astral-plane character, and passes every ASCII test — which is why anchor fields are named startCodePoint / endCodePoint and why this helper exists. Offsets are clamped rather than rejected; range checking against a document belongs to the origin library's validation.

      Parameters

      • text: string
      • startCodePoint: number
      • endCodePoint: number

      Returns string