@domorium/validator 1.8.0 → 1.8.2
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 +84 -0
- package/dist/index.cjs.js +2 -2
- package/dist/index.esm.js +373 -296
- package/dist/parser/lineIndex.d.ts +1 -0
- package/dist/validator/epoch.d.ts +11 -0
- package/dist/validator/rule-node.d.ts +1 -1
- package/dist/validator/validate.d.ts +3 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,90 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to `@domorium/validator` are documented here.
|
|
4
4
|
|
|
5
|
+
## 1.8.2 - 2026-08-18
|
|
6
|
+
|
|
7
|
+
- **A tag written in mixed case is read as written, and the message says which tag
|
|
8
|
+
is meant.** `1 NoTe hello` was reported as "Unknown tag N" — the tag pattern held
|
|
9
|
+
upper case only, so it matched as far as `N` and `oTe hello` became the value, and
|
|
10
|
+
the reader was told about a tag that is nowhere in their file. The tag is now read
|
|
11
|
+
whole and the message says a tag is written in upper case, naming `NOTE`. Where
|
|
12
|
+
case is not the problem, `1 NOTEE` still reads as an unknown tag.
|
|
13
|
+
- **A line carrying no level is reported once.** The parser says a GEDCOM line must
|
|
14
|
+
begin with a level, and the validator no longer adds its own word about the tag of
|
|
15
|
+
a line that is not a line.
|
|
16
|
+
|
|
17
|
+
- **A tag declared twice in `HEAD.SCHMA` with different URIs is no longer reported.**
|
|
18
|
+
The specification permits it — "the schema structure may contain the same tag more
|
|
19
|
+
than once with different URIs" — and its own `extensions.ged` declares `_PARTY`
|
|
20
|
+
twice, once for a substructure and once for a record. The check now asks whether
|
|
21
|
+
the same tag was declared twice with the _same_ URI, which says nothing the first
|
|
22
|
+
declaration did not. Which of several URIs applies where a tag is used is a
|
|
23
|
+
separate question.
|
|
24
|
+
|
|
25
|
+
- **A line the lexer cannot read is reported once, in words about GEDCOM.** An xref
|
|
26
|
+
with a space in it — `0 @NoTe ref@ NOTE …` — produced "unexpected character:
|
|
27
|
+
->@<- at offset: 199, skipped 1 characters", which is true of the scanner and no
|
|
28
|
+
use to a reader. The lexer then resumed one character on, so the wreckage lexed
|
|
29
|
+
into a tag `N` and a value, and the line was reported a second time as an unknown
|
|
30
|
+
tag that is nowhere in the file. Such a line now yields one diagnostic, saying an
|
|
31
|
+
xref holds letters, digits and underscore between two @ marks, and its tokens are
|
|
32
|
+
dropped rather than read as something else. The lines around it are untouched.
|
|
33
|
+
- **An unknown tag at the top level says `root`** where it said `undefined`. The
|
|
34
|
+
message about a missing tag has said `root` all along.
|
|
35
|
+
- **A file whose lines end in CR is read as a file, not as one line.** 5.5.1 ends a
|
|
36
|
+
line with CR, LF, CR-LF or LF-CR; the lexer's terminator was `\r?\n` and the line
|
|
37
|
+
index counted only LF, so a CR-only document parsed to a single node, its version
|
|
38
|
+
was never found, and everything above the lexer worked from one line. All four
|
|
39
|
+
terminators now end a line, a two-character form counts as one, and positions come
|
|
40
|
+
out the same whichever is used.
|
|
41
|
+
|
|
42
|
+
- **A required tag missing from a childless parent is reported where it is
|
|
43
|
+
missing.** The position came from the parent of the first child, so a parent with
|
|
44
|
+
no children at all had no position to offer and the report landed on line 1. In a
|
|
45
|
+
105 707-line export that put ten `Missing required tag FORM in FILE` diagnostics
|
|
46
|
+
at the top of the document, a hundred thousand lines from the media references
|
|
47
|
+
they describe.
|
|
48
|
+
- **Six closed value sets in 5.5.1 are checked at last.** `QUAY 9`, `PEDI nonsense`,
|
|
49
|
+
`RESN whatever`, `ORDI maybe`, `STAT nonsense` under `FAMC` and `ADOP nonsense`
|
|
50
|
+
under `INDI.ADOP.FAMC` all passed, because 5.5.1 states these sets in its
|
|
51
|
+
primitive definitions rather than in an enumeration vocabulary, and a payload
|
|
52
|
+
type the field-type switch did not name was validated as free text. Each now
|
|
53
|
+
names its set in the scheme and is judged by the rule that already existed for
|
|
54
|
+
GEDCOM 7 enumerations. Every real export in the corpus already wrote these
|
|
55
|
+
correctly, so nothing new is reported there. Completion offers the same values
|
|
56
|
+
while one is typed, because it reads the same sets: a `PEDI` line in a 5.5.1
|
|
57
|
+
file now proposes `adopted`, `birth`, `foster` and `sealing`.
|
|
58
|
+
- **A BC year in a 5.5.1 file is read in the spellings exports write.** `1472 B.C.`
|
|
59
|
+
passed while `1472 BC`, `1472BC` and `1472B.C.` were reported, though `YEAR_GREG`
|
|
60
|
+
carries no epoch at all and the specification only says in prose that "(B.C.)"
|
|
61
|
+
appended to the year marks a date before the common era — pinning neither the
|
|
62
|
+
spelling nor the delimiter. Every spelling now reads as the same era, in the
|
|
63
|
+
validity check and in the leap-year rule alike, so `29 FEB 1000 BC` is no longer
|
|
64
|
+
judged by whether 1000 was a leap year. Free text stays reported: `609 BC Megiddo`
|
|
65
|
+
and `abt. 716 BC (or 725)` belong in `DATE_PHRASE` parentheses. GEDCOM 7 is
|
|
66
|
+
unchanged, where `epoch = %s"BCE"` says exactly what is allowed.
|
|
67
|
+
- **An age in a 5.5.1 file is no longer judged by GEDCOM 7's grammar.** `AGE <8y`
|
|
68
|
+
was reported while `AGE < 8y` passed, and `8Y` and `child` were reported while
|
|
69
|
+
`8y` and `CHILD` passed. One expression served both versions, and it was
|
|
70
|
+
written to v7's ABNF, where the delimiter after `<` or `>` is required and
|
|
71
|
+
`years = Integer %x79` pins the unit letter. 5.5.1 prints neither rule, and
|
|
72
|
+
real exports write both forms, so 5.5.1 ages are now read without a required
|
|
73
|
+
delimiter and without regard to case. v7 keeps its ABNF exactly.
|
|
74
|
+
|
|
75
|
+
## 1.8.1 - 2026-08-17
|
|
76
|
+
|
|
77
|
+
- **A note written as text in a 5.5.1 file is no longer reported.** `1 NOTE plain
|
|
78
|
+
text` was told to be a pointer to a `NOTE` record, though `NOTE_STRUCTURE` has
|
|
79
|
+
two forms and the text itself is the second. A note that ran to a `CONT` line
|
|
80
|
+
escaped, because the pointer rule stays silent for a structure with children,
|
|
81
|
+
so the report landed only on one-line notes — which every export from
|
|
82
|
+
MyHeritage, Ancestry and Gramps is full of. The schema still names the pointer
|
|
83
|
+
form, which is the one with a target to resolve and to complete.
|
|
84
|
+
- **A source citation carrying its description is no longer reported either.**
|
|
85
|
+
`1 SOUR Parish register, Warsaw, vol 3 p 41` is the branch 5.5.1 provides for
|
|
86
|
+
systems that keep no source records, and `TEXT` written beneath it is no longer
|
|
87
|
+
an unknown tag. See [ADR 0010](../../docs/adr/0010-two-form-structures-in-5-5-1.md).
|
|
88
|
+
|
|
5
89
|
## 1.8.0 - 2026-08-14
|
|
6
90
|
|
|
7
91
|
- **A header naming a system before `GEDC` is Personal Ancestral File, and is no
|