Upgrade and rework documentation generator (TypeDoc).
4.11.0 (June 1, 2024)
Make PGN parsing tolerant to missing end-of-game token at the very end of the PGN string (see #46).
4.10.0 (March 9, 2024)
Add support for NAGs $20 and $21.
4.9.2 (March 3, 2024)
Minor fixes.
4.9.1 (February 25, 2024)
Fix inconsistent object returned by Game.findById() for ID aliases.
4.9.0 (February 25, 2024)
Make Game.findById() work with ID aliases (e.g. 'end' to indicate the last node in the main variation).
4.8.1 (January 20, 2024)
Compile TypeScript to ES2020 (except for standalone lib).
Minor fixes in code and dependencies.
4.8.0 (September 5, 2023)
Add method Node.fiftyMoveClock() to retrieve the number of half-moves since the last pawn move or capture.
Add method Node.fen() to retrieve the FEN representation of the position on a game node, with the FEN counters (fifty-move clock and full-move number)
set according to the move history of the game (see #43). Add similarly methods Game.initialFEN()
and Game.finalFEN() to retrieve the FEN representations of the initial and final position of a game.
4.7.0 (May 25, 2023)
Add methods AbstractNode.clearNags() and AbstractNode.filterNags(..) to remove all the NAGs from a node or variation, or to keep only a subset of them.
Add methods AbstractNode.clearTags() and AbstractNode.filterTags(..) to achieve similar operations on the key-value tag pairs of a node or variation.
4.6.2 (April 21, 2023)
Fix tag formatting in comments written by pgnWrite(..).
4.6.1 (April 10, 2023)
Fix parsing of multi-part text comments (see #40).
Introduce type SquareCouple to represent an ordered pair of squares, or a displacement on a chessboard.
4.2.1 (January 31, 2023)
Continuous integration with GitHub Actions instead of Travis-CI.
4.2.0 (January 24, 2023)
Introduce Game.finalPosition() and Variation.finalPosition() to retrieve the position at the end of a game or sub-variation.
4.1.0 (January 20, 2023)
Introduce Node.removePrecedingMoves() to erase the beginning of a game up to a given move.
4.0.1 (January 4, 2023)
Introduce Game.fullRound() to get a human-readable string representation of the round, sub-round and sub-sub-round all together.
4.0.0 (January 4, 2023)
Introduce Game.initialFullMoveNumber() and Game.clearHeaders().
Introduce Game.pojo() and Game.fromPOJO() to convert back and forth between a Game instance
and its corresponding POJO representation,
hence allowing JSON serialization/de-serialization of a Game instance, deep cloning, etc...
Breaking changes affecting Game.round(): look at the migration guide
for more details.
3.3.0 (October 12, 2022)
Introduce Position.isDead() to detect positions in which the remaining material is not sufficient for any player to checkmate its opponent
(aka. dead positions).
Add support for PGN tags Opening, Variation, and SubVariation (description of the opening).
Add support for PGN tag Termination (description of the reason for the conclusion of the game).
Add an option to write the PlyCount tags (number of half-moves of the game) in the PGN generated by pgnWrite(..).
3.1.0 (September 12, 2022)
Introduce effective castling (see #32) and effective en-passant
(see #31), in order to make parsing of FEN strings with unreliable castling and/or
en-passant flags easier, and to ensure that Position.isEqual(..) do work as expected even in case of move order transposition
(see discussion in #27).
3.0.0 (August 26, 2022)
Migration to TypeScript.
Breaking changes affecting ES6 default imports, and methods Game.date() and Game.playerElo():
look at the migration guide for more details.
2.9.2 (July 14, 2022)
Fix PGN parsing issues regarding move number 0 and degenerated backslash followed by a linebreak
(see #30).
2.9.1 (July 1, 2022)
Fix castling move validation at Chess960 (see #29).
2.9.0 (June 21, 2022)
Introduce Node.isVariation() and Variation.isVariation() to discriminate between Node and Variation instances.
Add support for NAGs RR and N in pgnRead(..).
Fix behavior of pgnRead(..) when invoked with no game index: now, the function is guaranteed to not throw InvalidPGN
(thus it always returns a Database object).
Improve formatting of the PGN generated by pgnWrite(..).
Change the heuristic used by pgnRead(..) to decide whether a variation comment is a long or a short comment:
from now on, a variation comment is considered as "long" if and only if it is followed by a blank line in the PGN
(instead of preceded, as it used to be). No change regarding how node comments are processed.
2.8.1 (June 16, 2022)
Fix update procedure for en-passant flag in Position.play(..) (see #27).
2.8.0 (May 18, 2022)
Add support for NAGs $141, $143 and RR.
Remove dependency with security issue.
2.7.0 (April 21, 2022)
Introduce Game.nodes(..) to retrieve all the moves of a game (optionally with those coming from the sub-variations).
Introduce Position.isEqual(..) to check whether two instances of Position are identical or not.
2.6.0 (April 6, 2022)
Add methods to move backward in the move tree: Node.previous(), Node.parentVariation() and Variation.parentNode().
Introduce nagSymbol(..) to retrieve the human-readable symbols associated to each
NAG.
2.5.0 (March 31, 2022)
Introduce Node.id(), Variation.id() and Game.findById(..).
2.4.1 (March 27, 2022)
Fix behavior of Database#game(..) with invalid indexes (see #24).
2.4.0 (March 27, 2022)
Expose Database (thus allowing for ... instanceof Database).
2.3.0 (February 22, 2022)
Enrich variation-management methods on Game and related objects: Node.promoteVariation(),
Node.removeVariation(), Node.removeFollowingMoves()... (see #22).
Change the way castling moves are handled at Chess960 in Position.isMoveLegal(): from now one,
castling moves will be recognized as legal if and only if argument to corresponds to the origin square
of the castling rook. As a consequence, no confusion is possible anymore between castling and regular king moves,
and status castle960 do not exist anymore among the objects that can be returned by Position.isMoveLegal().
This change affects only Chess960; regular chess and other variants are not impacted.
1.10.2 (August 15, 2021)
Support castling moves encoded with zeros (see #6).
Improve PGN parsing robustness to linebreak issues (see #11).
Introduce Variations.nodes() (see #9).
WARNING! This impacts the lifecycle of the Node objects returned by Node.next() and Node.play(..):
now, these functions always return a new instance of Node, instead of reusing the current one.