• Tokenization function to split the expression into meaningful tokens.

    Parameters

    • expression: string

      The expression to tokenize.

    Returns string[]

    A list with the tokens of the expression.

    Example

    // Example usage:
    import { tokenize } from "@zk-kit/logical-expressions"

    const expression = "true and false or ( true and true )"

    const tokens = tokenize(expression)

    console.log(tokens)
    // Output: ["true", "and", "false", "or", "(", "true", "and", "true", ")"]