Function parseOne

  • Parses a single UCI command.

    Example

    import { expect } from "vitest"
    import parseOne from "uci-parser-ts/parseOne"
    import BestMoveCommand from "uci-parser-ts/BestMoveCommand"

    const command = parseOne("bestmove e2e4 ponder e7e5");

    expect(command).toBeInstanceOf(BestMoveCommand);
    expect(command.move).toBe("e2e4");
    expect(command.ponder).toBe("e7e5");

    Throws

    If the command is not valid UCI.

    Returns

    The parsed command.

    Parameters

    • command: string

      The command to parse.

    Returns Command

Generated using TypeDoc