Interface Token

A token created when parsing a string.

interface Token {
    type: TokenType;
    equals(token: Token): boolean;
    is(type: TokenType): boolean;
    toFilter(): string;
    toJSON(): { type: string; [prop: string]: HaysonVal | string[] };
    toString(): string;
}

Implemented by

Properties

Methods

Properties

type: TokenType

The type of token.

Methods

  • Returns true if the object matches this one.

    Parameters

    Returns boolean

    True if the objects are equal.

  • Encodes to an encoded zinc value that can be used in a haystack filter string.

    The encoding for a haystack filter is mostly zinc but contains some exceptions.

    Returns string

    The encoded value that can be used in a haystack filter.