Builds the UnicodeTrie data structure with options to output to a Buffer or return an instance of UnicodeTrie.

Constructors

Methods

  • Parameters

    • codePoint: number

      Code point to lookup.

    • Optional fromLSCP: boolean

      Is this a lead surrogate code point.

    Returns number

  • Parameters

    • codePoint: number

      Code point to set.

    • value: number

      New value at code point.

    Returns this

  • Parameters

    • start: number

      Start code point.

    • end: number

      End code point.

    • value: number

      Value to set.

    • Optional overwrite: boolean

      Overwrite existing values.

    Returns this

  • Generates a Node Buffer containing the serialized and compressed trie.

    Note: This only works on Node. Use toUint8Array otherwise.

    uint32_t highStart; uint32_t errorValue; uint32_t uncompressedDataLength; uint8_t trieData[dataLength];

    Returns Buffer

    A Node Buffer.

  • Generates a packed Uint8Array containing the serialized and compressed trie.

    Note: This only works on Node. Use toUint8Array otherwise.

    uint32_t highStart; uint32_t errorValue; uint32_t uncompressedDataLength; uint8_t trieData[dataLength];

    Returns Uint8Array

    A packed Uint8Array.