Staquia API
    Preparing search index...

    Class OverflowError

    Returned (never thrown) when there is no valid position to create:

    • the new position would be longer than the max length lmax = ln + lz of the system, or
    • next was asked for an N that is already the last value (every digit is last), or previous for an N that is already the first one (every digit is zero).

    The positions must be spaced again (LexicalList.sort) before inserting there.

    import Staquia, { OverflowError } from "staquia";

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

    const result = system.next(system.forge("zzzzz"));
    if (!result.ok && result.error instanceof OverflowError) {
    console.log(result.error.position.toString()); // "zzzzz!", the position that can't move
    }

    Hierarchy

    • Error
      • OverflowError
    Index

    Constructors

    Properties

    Accessors

    Methods

    Constructors

    Properties

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

    Accessors

    Methods

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

      Parameters

      • error: unknown

      Returns error is Error

    • Creates an overflow for a position whose n section is already at its limit, so there is no next (all digits are the last value) or previous (all digits are zero) value for it.

      Parameters

      • position: IPosition

        The position that can't move in the requested direction.

      • direction: "next" | "previous"

        The direction that was requested.

      Returns OverflowError