UNPKG

@chess-fu/pgn-parser

Version:

Chess PGN parser for 8x8 chess games for import or export standards

25 lines 753 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); var PgnGame = (function () { function PgnGame() { this.headers = []; this.history = []; } PgnGame.prototype.headersMap = function () { var result = {}; for (var _i = 0, _a = this.headers; _i < _a.length; _i++) { var header = _a[_i]; if (header.name && header.value) { result[header.name] = header.value; } } return result; }; PgnGame.prototype.moves = function () { return this.history.filter(function (m) { return m.san; }); }; return PgnGame; }()); exports.PgnGame = PgnGame; exports.default = PgnGame; //# sourceMappingURL=pgnGame.js.map