UNPKG

lexer-state

Version:

Lightweight state machine library to define and manage state transition declaratively

30 lines 1.07 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.MachineNotFoundError = exports.LexerStateHookError = exports.StateError = void 0; const ErrorMessages = { StateError: 'undefined state transition', HookMachineError: 'machine is undefined, must initialize useLexerState(machine:?) with a machine', MachineNotFoundError: 'machine is undefined', }; class StateError extends Error { constructor(message = ErrorMessages.StateError) { super(message); this.name = 'StateError'; } } exports.StateError = StateError; class LexerStateHookError extends Error { constructor(message = ErrorMessages.HookMachineError) { super(message); this.name = 'HookMachineError'; } } exports.LexerStateHookError = LexerStateHookError; class MachineNotFoundError extends Error { constructor(message = ErrorMessages.MachineNotFoundError) { super(message); this.name = 'MachineNotFoundError'; } } exports.MachineNotFoundError = MachineNotFoundError; //# sourceMappingURL=index.js.map