Class used to support matching a particular token

Constructors

Methods

Constructors

  • Create this with a string that is translated to a UTF8 token to match in binary.

    Parameters

    • from: string

      The string to create this from.

    Returns default

Methods

  • The matching function for the token.

    Parameters

    • buffer: Uint8Array

      The buffer to match the token in.

    • cursor: number

      The position in the buffer to match the token at.

    • endCursor: number

      The end position in the buffer to finish the match search.

    Returns undefined | number

    The cursor that corresponds to the end of the match for the token.