You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
stringify(input: PGN | PGN[], options?: StringifyOptions): string — converts
parsed PGN objects back to valid PGN strings (semantic round-trip fidelity).
Accepts a single game or an array of games. Reconstructs SAN from Move
fields, re-serializes annotation commands ([%cal], [%csl], [%clk], [%eval]) back into comment blocks, and preserves RAVs and NAGs. Fires onWarning for recoverable issues (invalid castling destination, negative
clock).
Changed
src/index.ts refactored into focused internal modules (src/types.ts, src/parse.ts, src/stream.ts, src/stringify.ts). Public API unchanged.
Fixed
Tagless games with no moves (e.g. [Result "*"]\n\n*) now parse correctly.
Previously the grammar required at least one move in the movetext.