@domorium/validator 1.1.0 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +51 -0
- package/dist/index.cjs.js +2 -2
- package/dist/index.esm.js +612 -479
- package/dist/parser/ast.d.ts +63 -0
- package/dist/parser/index.d.ts +2 -2
- package/dist/parser/lineIndex.d.ts +9 -0
- package/dist/validator/date-v7.d.ts +8 -0
- package/dist/validator/rule-node.d.ts +5 -0
- package/package.json +1 -1
- package/dist/parser/parser.d.ts +0 -7
- package/dist/parser/visitor.d.ts +0 -43
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,57 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to `@domorium/validator` are documented here.
|
|
4
4
|
|
|
5
|
+
## 1.3.0 - 2026-08-08
|
|
6
|
+
|
|
7
|
+
- Read GEDCOM 7 dates against the calendar they name. `JULIAN 1401`,
|
|
8
|
+
`HEBREW 1 TSH 5761`, `FRENCH_R 2 VEND 8` and even `GREGORIAN 1 JAN 2000` were
|
|
9
|
+
all reported as invalid, because only v5.5.1's `@#D…@` escape was understood.
|
|
10
|
+
Each calendar's own months and epochs now apply, so `HEBREW 1 JAN 5761` is
|
|
11
|
+
refused and `BCE` is confined to the two calendars that permit it. A calendar
|
|
12
|
+
binds to the date after it, so `FROM JULIAN 1670 TO GREGORIAN 1800` is two
|
|
13
|
+
dates in two calendars.
|
|
14
|
+
- **Three v5.5.1 date forms are now refused inside a 7.0 document**, which may
|
|
15
|
+
make a file that was quiet noisy: the `@#D…@` calendar escape, a slashed year
|
|
16
|
+
such as `1 JAN 1857/58`, and the `INT 1950 (around 1950)` and `(unknown)`
|
|
17
|
+
phrase forms. Version 7.0 removed all three; a date phrase belongs in a
|
|
18
|
+
`PHRASE` substructure. GEDCOM 5.5.1 documents keep them.
|
|
19
|
+
- Stop reporting a payload the specification allows to be omitted. A payload may
|
|
20
|
+
be left out whenever its data type admits the empty string, which covers 61 of
|
|
21
|
+
the 182 payload types — `1 EVEN` with only a `TYPE` beneath it was being
|
|
22
|
+
flagged. `AGE`, `DateValue` and `DatePeriod` have their own explicit
|
|
23
|
+
permission: omitting the payload and giving a `PHRASE` instead is the
|
|
24
|
+
specification's own way to record that something happened but not what.
|
|
25
|
+
- Accept a leading UTF-8 byte order mark instead of reporting it as an
|
|
26
|
+
unexpected character. This was invisible in a browser, which strips the mark
|
|
27
|
+
while decoding, and affected anyone reading a file from disk.
|
|
28
|
+
- Say what belongs in a pointer slot. `Value for SOUR should be POINTER` named
|
|
29
|
+
the rule rather than the problem; a payload that is not a pointer at all now
|
|
30
|
+
reads `should be a pointer to a SOUR record, written as "@xref@"`, while an
|
|
31
|
+
xref that resolves to nothing names the records it could have meant.
|
|
32
|
+
|
|
33
|
+
## 1.2.0 - 2026-08-07
|
|
34
|
+
|
|
35
|
+
- Keep the spaces that belong to a value. The lexer treated the delimiter after
|
|
36
|
+
a tag as whitespace to skip, so a `NOTE` whose text began with spaces lost
|
|
37
|
+
them, and `CONC` continuations silently changed the text they rejoined.
|
|
38
|
+
- Report a value that begins with a leading space or ends with a trailing one
|
|
39
|
+
correctly rather than validating a string the document never contained.
|
|
40
|
+
- Name at most ten candidates when a payload is not in its permitted set, and
|
|
41
|
+
count the rest, joining them with `", "`. The full list is every matching
|
|
42
|
+
xref in the document, and interpolating it produced a message tens of
|
|
43
|
+
thousands of characters long with no break opportunity in it — enough to
|
|
44
|
+
stretch an editor's diagnostic tooltip past the edge of the screen.
|
|
45
|
+
- `ASTNode` and `ASTToken` now carry `startOffset` and `endOffset`, and their
|
|
46
|
+
`range` is derived from those on access rather than stored. This is what makes
|
|
47
|
+
a large document affordable: a stored range costs three objects per token, and
|
|
48
|
+
that was most of the syntax tree's memory. `range` is `readonly` as a result —
|
|
49
|
+
code that assigned to it must set the offsets instead, and code in a tight loop
|
|
50
|
+
should read the offsets, because reading `range` allocates.
|
|
51
|
+
- Build the syntax tree straight from the token stream instead of walking a
|
|
52
|
+
Chevrotain parse tree first, and index pointer targets once per document
|
|
53
|
+
rather than scanning every pointer for each one. Validation cost no longer
|
|
54
|
+
grows with records times nodes.
|
|
55
|
+
|
|
5
56
|
## 1.1.0 - 2026-08-06
|
|
6
57
|
|
|
7
58
|
- Accept application-defined extension tags (`_XXXX`) instead of reporting them
|