UNPKG

chess-legal-moves

Version:

Analyses a given chess game position in Fen notation to return legal moves and provides the next game position after a given move

16 lines (15 loc) 552 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var regex_1 = require("./regex"); exports.default = { fenStringSyntax: function (fenString) { var isValidFen = fenString.match(regex_1.default.fenString); if (!isValidFen) throw new Error('The provided fen string syntax is not valid'); }, moveSyntax: function (move) { var isValidMove = move.match(regex_1.default.move); if (!isValidMove) throw new Error('The provided move syntax is not valid'); }, };