@domorium/validator 1.6.0 → 1.8.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 +47 -0
- package/dist/completion/dateSlot.d.ts +17 -0
- package/dist/index.cjs.js +2 -2
- package/dist/index.esm.js +1621 -1052
- package/dist/types/errors.d.ts +4 -0
- package/dist/validator/calendarDays.d.ts +17 -0
- package/dist/validator/versionRegistry.d.ts +6 -0
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,53 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to `@domorium/validator` are documented here.
|
|
4
4
|
|
|
5
|
+
## 1.8.0 - 2026-08-14
|
|
6
|
+
|
|
7
|
+
- **A header naming a system before `GEDC` is Personal Ancestral File, and is no
|
|
8
|
+
longer judged by a specification that does not apply to it.** FamilySearch's
|
|
9
|
+
version-detection algorithm reads until whichever of `1 GEDC` and `1 SYST`
|
|
10
|
+
comes first; `1 SYST` skips the version entirely and sends the file to the PAF
|
|
11
|
+
specification. We read the `VERS` line regardless, resolved 5.5.1 and reported
|
|
12
|
+
five diagnostics from a schema the algorithm says is not the file's.
|
|
13
|
+
- `VAL015` says so and nothing else is reported, the way an unsupported version
|
|
14
|
+
already behaves. `getVersionResolution()` gains a `paf` kind carrying the
|
|
15
|
+
system the header named. Writing a PAF schema is not in scope; saying plainly
|
|
16
|
+
that this dialect is not judged here is.
|
|
17
|
+
- A `1 SYST` **after** `1 GEDC` changes nothing, which is what the algorithm
|
|
18
|
+
says: whichever comes first decides.
|
|
19
|
+
|
|
20
|
+
## 1.7.0 - 2026-08-13
|
|
21
|
+
|
|
22
|
+
- **A date payload offers completions, and they depend on where the cursor is.**
|
|
23
|
+
Typing one got no help at all, in a format where the help is most needed. The
|
|
24
|
+
start of a value offers the calendars, the modifiers and the months; after a
|
|
25
|
+
number, the months it could still take and the epoch it could already be;
|
|
26
|
+
after `BET`'s first date, `AND`; after `FROM`'s, `TO`. An exact date is offered
|
|
27
|
+
months alone, since its grammar admits no calendar and no epoch.
|
|
28
|
+
- **The months offered are the ones the calendar in force actually has.**
|
|
29
|
+
a cursor after `HEBREW 1` offers `TSH` through `ELL`, one after `FRENCH_R`
|
|
30
|
+
offers `VEND` through `COMP`, and the twelve a user knows by heart are not among them. This is the
|
|
31
|
+
case the feature is for.
|
|
32
|
+
- GEDCOM 7 only. 5.5.1 keeps its months in a regular expression and its
|
|
33
|
+
`calendar` section is empty, so there is nothing there to offer from.
|
|
34
|
+
|
|
35
|
+
- **A date naming a day the calendar does not have is reported.** `31 FEB 1900`,
|
|
36
|
+
`31 APR 1880`, `0 JAN` and `99 JAN` were all accepted: the grammar gives a day
|
|
37
|
+
as one or two digits, and nothing looked at the month it belongs to. Each now
|
|
38
|
+
carries `VAL014` saying which day was named and how many the month has. So does
|
|
39
|
+
`29 FEB 1900` — a year divisible by 100 and not by 400 has no 29th — while
|
|
40
|
+
`29 FEB 2000` and `29 FEB 2024` stay quiet.
|
|
41
|
+
- The check is separate from the grammar and reported with a code of its own,
|
|
42
|
+
because `31 FEB 1900` _is_ a date: telling its author it is not one would say
|
|
43
|
+
the wrong thing about a value they can see is a date.
|
|
44
|
+
- **A Julian date is judged by the Julian rule**, which keeps every fourth year
|
|
45
|
+
leap with no exception for centuries, so `JULIAN 29 FEB 1700` is accepted where
|
|
46
|
+
the same day in the Gregorian calendar is not. `HEBREW` and `FRENCH_R` have
|
|
47
|
+
months of their own and are not judged by anyone else's calendar. Both dialects
|
|
48
|
+
are covered, including 5.5.1's `@#DJULIAN@` escape.
|
|
49
|
+
- A phrase is removed before a value is read as a date, so
|
|
50
|
+
`INT 1900 (born 31 FEB by the old reckoning)` reports nothing.
|
|
51
|
+
|
|
5
52
|
## 1.6.0 - 2026-08-12
|
|
6
53
|
|
|
7
54
|
- **A fragment can be checked without being told it is not a file.** Text that is
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Which part of a date the cursor is in. A flat list would be worse than
|
|
3
|
+
* nothing here: the months worth offering depend on the calendar named a few
|
|
4
|
+
* tokens earlier, and the keywords depend on what the value opened with.
|
|
5
|
+
*/
|
|
6
|
+
export type DateGrammar = "value" | "period" | "exact";
|
|
7
|
+
export interface DateSlot {
|
|
8
|
+
/** A calendar may be named here. */
|
|
9
|
+
calendars: boolean;
|
|
10
|
+
/** Whose months may be named here, or null where none may. */
|
|
11
|
+
months: string | null;
|
|
12
|
+
/** Whose epochs may be named here, or null where none may. */
|
|
13
|
+
epochs: string | null;
|
|
14
|
+
/** Bare words the grammar allows here. */
|
|
15
|
+
keywords: string[];
|
|
16
|
+
}
|
|
17
|
+
export declare function dateSlot(typed: string, grammar: DateGrammar): DateSlot;
|