Staquia API
    Preparing search index...

    Class LexicalError

    Returned (never thrown) when a LexicalList operation fails; its type tells why. When an operation returns an error, neither the list nor your objects were changed.

    import Staquia, { LexicalList } from "staquia";

    const list = new LexicalList(Staquia.create("!", "a", "z", 5, 15, 0.15));

    const result = list.move(9, 1, 2);
    if (!result.ok) console.log(result.error.type); // "not-found"

    Hierarchy

    • Error
      • LexicalError
    Index

    Constructors

    Properties

    cause?: unknown
    message: string
    name: string
    stack?: string

    Accessors

    Methods

    • Creates a LexicalError representing an item whose position is empty or can't be forged.

      Parameters

      • id: unknown

        The identifier of the item.

      • position: string

        The invalid position.

      • reason: string

        Why the position is not valid.

      Returns LexicalError

    • Indicates whether the argument provided is a built-in Error instance or not.

      Parameters

      • error: unknown

      Returns error is Error

    • Creates a LexicalError representing values whose positions are not in ascending order.

      Parameters

      • index: number

        The index of the first value that breaks the order.

      • previousId: unknown

        The id of the value before it.

      • previous: string

        The position of the value before it.

      • id: unknown

        The id of the value that breaks the order.

      • position: string

        Its position.

      Returns LexicalError