Skip to content

Commit 5555537

Browse files
committed
chore: bump version to 3.8.0 and update changelog
1 parent 99d49f8 commit 5555537

File tree

3 files changed

+33
-6
lines changed

3 files changed

+33
-6
lines changed

CHANGELOG.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,27 @@ and this project adheres to
88

99
## [Unreleased]
1010

11+
## [3.8.0] - 2026-03-15
12+
13+
### Added
14+
15+
- `onWarning` now fires for move number mismatches (e.g. `5. e4` appearing as
16+
the first move). Previously emitted unconditionally to `console.warn`; now
17+
routed through `onWarning` when provided. `console.warn` is no longer called
18+
for move number mismatches — if you relied on it, add an `onWarning` callback.
19+
- `onWarning` fires when the `[Result "..."]` tag value does not match the game
20+
termination marker at the end of the movetext (e.g. `[Result "1/2-1/2"]` with
21+
a `1-0` termination marker).
22+
- `onWarning` fires for duplicate tag names (same tag appearing more than once
23+
in the tag pair section). The `line` and `column` fields point to the opening
24+
`[` of the duplicate — exact source position, not a nominal placeholder.
25+
26+
### Changed
27+
28+
- Move number mismatch no longer emits to `console.warn` when `onWarning` is not
29+
provided. It is now silently ignored, consistent with how missing STR tag
30+
warnings are handled.
31+
1132
## [3.7.0] - 2026-03-15
1233

1334
### Added

README.md

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -152,14 +152,20 @@ const games = parse(input, {
152152
`onWarning` receives a `ParseWarning` with the same fields as `ParseError`:
153153
`message`, `offset`, `line`, `column`.
154154

155-
Currently fires for: missing STR tags (`Event`, `Site`, `Date`, `Round`,
156-
`White`, `Black`, `Result`). Warnings are emitted in alphabetical key order.
155+
Currently fires for:
156+
157+
- Missing STR tags (`Black`, `Date`, `Event`, `Result`, `Round`, `Site`,
158+
`White`) — emitted in alphabetical key order; position fields are nominal
159+
placeholders
160+
- Move number mismatch (declared move number in the PGN text doesn't match the
161+
move's actual position) — position fields are nominal placeholders
162+
- Result tag mismatch (`[Result "..."]` tag value differs from the game
163+
termination marker) — position fields are nominal placeholders
164+
- Duplicate tag names — `line` and `column` point to the opening `[` of the
165+
duplicate tag
157166

158167
The same option is accepted by `stream()`.
159168

160-
> **Note:** `onWarning` position fields (`offset`, `line`, `column`) are nominal
161-
> placeholders — missing tags have no source location.
162-
163169
### PGN object
164170

165171
```typescript

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,5 +82,5 @@
8282
},
8383
"type": "module",
8484
"types": "dist/index.d.ts",
85-
"version": "3.7.0"
85+
"version": "3.8.0"
8686
}

0 commit comments

Comments
 (0)