Staquia API
    Preparing search index...

    Class InvalidCharacterError

    Returned (never thrown) by forge when the string has a character that is not a digit of the system: neither the zero nor a character from first to last. Check positions coming from outside (an API, a form) with forge before storing them.

    import Staquia, { InvalidCharacterError } from "staquia";

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

    const result = system.forge("abC");
    if (!result.ok && result.error instanceof InvalidCharacterError) {
    console.log(result.error.index); // 2, the "C"
    }

    Hierarchy

    • Error
      • InvalidCharacterError
    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