@domorium/validator 1.6.0 → 1.7.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.
@@ -30,6 +30,8 @@ export declare enum GedcomErrorCode {
30
30
  UndeterminedVersion = "VAL012",
31
31
  /** A version checked against a different version's schema. */
32
32
  SubstitutedVersion = "VAL013",
33
+ /** A date naming a day its calendar does not have, such as 31 FEB. */
34
+ ImpossibleDay = "VAL014",
33
35
  /** A pointer whose xref names no record of the required type. */
34
36
  UnresolvedXref = "unresolved-xref",
35
37
  /** A line whose level cannot follow the line above it. */
@@ -0,0 +1,17 @@
1
+ /**
2
+ * The part of a date the grammar cannot express: `31 FEB` is two well-formed
3
+ * tokens naming a day February does not have.
4
+ *
5
+ * GREGORIAN and JULIAN share the twelve month tags and their lengths, and
6
+ * differ only in which years February gets a 29th, which is why one table
7
+ * serves both. HEBREW and FRENCH_R have months of their own.
8
+ */
9
+ export interface ImpossibleDay {
10
+ day: number;
11
+ month: string;
12
+ /** What the month does have, for a message that says more than "wrong". */
13
+ length: number;
14
+ }
15
+ export declare function isLeapYear(year: number, calendar: string): boolean;
16
+ export declare function daysInMonth(month: string, year: number | null, calendar: string): number | null;
17
+ export declare function impossibleDays(value: string): ImpossibleDay[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@domorium/validator",
3
- "version": "1.6.0",
3
+ "version": "1.7.0",
4
4
  "description": "GEDCOM 5.5.1 and 7.0 parser and validator",
5
5
  "keywords": [
6
6
  "gedcom",