@treeviz/gedcom-parser 1.0.3 → 1.0.5
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/dist/classes/common.d.ts +8 -4
- package/dist/classes/common.d.ts.map +1 -1
- package/dist/classes/common.js +7 -0
- package/dist/classes/date.d.ts +1 -1
- package/dist/classes/date.d.ts.map +1 -1
- package/dist/classes/date.js +1 -1
- package/dist/classes/fam.d.ts +3 -3
- package/dist/classes/fam.d.ts.map +1 -1
- package/dist/classes/fams.d.ts +3 -3
- package/dist/classes/fams.d.ts.map +1 -1
- package/dist/classes/gedcom.d.ts +35 -14
- package/dist/classes/gedcom.d.ts.map +1 -1
- package/dist/classes/gedcom.js +312 -0
- package/dist/classes/indis.d.ts +5 -4
- package/dist/classes/indis.d.ts.map +1 -1
- package/dist/classes/indis.js +1 -1
- package/dist/classes/list.d.ts +4 -4
- package/dist/classes/list.d.ts.map +1 -1
- package/dist/classes/name.d.ts +1 -1
- package/dist/classes/name.d.ts.map +1 -1
- package/dist/classes/note.d.ts +1 -1
- package/dist/classes/note.d.ts.map +1 -1
- package/dist/classes/obje.d.ts +3 -3
- package/dist/classes/obje.d.ts.map +1 -1
- package/dist/classes/objes.d.ts +2 -2
- package/dist/classes/objes.d.ts.map +1 -1
- package/dist/classes/repo.d.ts +3 -3
- package/dist/classes/repo.d.ts.map +1 -1
- package/dist/classes/repos.d.ts +2 -2
- package/dist/classes/repos.d.ts.map +1 -1
- package/dist/classes/sour.d.ts +3 -3
- package/dist/classes/sour.d.ts.map +1 -1
- package/dist/classes/sours.d.ts +2 -2
- package/dist/classes/sours.d.ts.map +1 -1
- package/dist/classes/subm.d.ts +2 -2
- package/dist/classes/subm.d.ts.map +1 -1
- package/dist/classes/subms.d.ts +2 -2
- package/dist/classes/subms.d.ts.map +1 -1
- package/dist/cli/commands/convert.d.ts +1 -1
- package/dist/cli/commands/convert.d.ts.map +1 -1
- package/dist/cli/commands/extract.d.ts +1 -1
- package/dist/cli/commands/extract.d.ts.map +1 -1
- package/dist/cli/commands/extract.js +1 -1
- package/dist/cli/commands/find.d.ts +1 -1
- package/dist/cli/commands/find.d.ts.map +1 -1
- package/dist/cli/commands/info.d.ts +1 -1
- package/dist/cli/commands/info.d.ts.map +1 -1
- package/dist/cli/commands/merge.d.ts +1 -1
- package/dist/cli/commands/merge.d.ts.map +1 -1
- package/dist/cli/commands/merge.js +40 -72
- package/dist/cli/commands/relatives.d.ts +1 -1
- package/dist/cli/commands/relatives.d.ts.map +1 -1
- package/dist/cli/commands/show.d.ts +1 -1
- package/dist/cli/commands/show.d.ts.map +1 -1
- package/dist/cli/commands/stats.d.ts +1 -1
- package/dist/cli/commands/stats.d.ts.map +1 -1
- package/dist/cli/commands/stats.js +1 -1
- package/dist/cli/commands/validate.d.ts +1 -1
- package/dist/cli/commands/validate.d.ts.map +1 -1
- package/dist/cli/index.js +7 -7
- package/dist/constants/filters.d.ts +2 -1
- package/dist/constants/filters.d.ts.map +1 -1
- package/dist/constants/filters.js +1 -1
- package/dist/constants/orders.d.ts +2 -2
- package/dist/constants/orders.d.ts.map +1 -1
- package/dist/init.d.ts +91 -0
- package/dist/init.d.ts.map +1 -0
- package/dist/init.js +94 -0
- package/dist/interfaces/common.d.ts +3 -3
- package/dist/interfaces/common.d.ts.map +1 -1
- package/dist/interfaces/fam.d.ts +3 -3
- package/dist/interfaces/fam.d.ts.map +1 -1
- package/dist/interfaces/fams.d.ts +4 -4
- package/dist/interfaces/fams.d.ts.map +1 -1
- package/dist/interfaces/gedcom.d.ts +14 -14
- package/dist/interfaces/gedcom.d.ts.map +1 -1
- package/dist/interfaces/indi.d.ts +6 -6
- package/dist/interfaces/indi.d.ts.map +1 -1
- package/dist/interfaces/indis.d.ts +5 -5
- package/dist/interfaces/indis.d.ts.map +1 -1
- package/dist/interfaces/list.d.ts +4 -4
- package/dist/interfaces/list.d.ts.map +1 -1
- package/dist/interfaces/obje.d.ts +2 -2
- package/dist/interfaces/obje.d.ts.map +1 -1
- package/dist/interfaces/repo.d.ts +2 -2
- package/dist/interfaces/repo.d.ts.map +1 -1
- package/dist/interfaces/sour.d.ts +2 -2
- package/dist/interfaces/sour.d.ts.map +1 -1
- package/dist/interfaces/subm.d.ts +2 -2
- package/dist/interfaces/subm.d.ts.map +1 -1
- package/dist/kinship-translator/kinship-translator.basic.d.ts +1 -1
- package/dist/kinship-translator/kinship-translator.basic.d.ts.map +1 -1
- package/dist/kinship-translator/kinship-translator.d.ts +2 -2
- package/dist/kinship-translator/kinship-translator.d.ts.map +1 -1
- package/dist/kinship-translator/patterns.hu.d.ts +2 -2
- package/dist/kinship-translator/patterns.hu.d.ts.map +1 -1
- package/dist/structures/address.d.ts +1 -1
- package/dist/structures/address.d.ts.map +1 -1
- package/dist/structures/association.d.ts +1 -1
- package/dist/structures/association.d.ts.map +1 -1
- package/dist/structures/change-date.d.ts +1 -1
- package/dist/structures/change-date.d.ts.map +1 -1
- package/dist/structures/creation-date.d.ts +1 -1
- package/dist/structures/creation-date.d.ts.map +1 -1
- package/dist/structures/date.d.ts +2 -2
- package/dist/structures/date.d.ts.map +1 -1
- package/dist/structures/family.d.ts +1 -1
- package/dist/structures/family.d.ts.map +1 -1
- package/dist/structures/gedcom.d.ts +2 -3
- package/dist/structures/gedcom.d.ts.map +1 -1
- package/dist/structures/index.d.ts +24 -24
- package/dist/structures/index.d.ts.map +1 -1
- package/dist/structures/individual-event-detail-structure.d.ts +1 -1
- package/dist/structures/individual-event-detail-structure.d.ts.map +1 -1
- package/dist/structures/individual-event-structure.d.ts +1 -1
- package/dist/structures/individual-event-structure.d.ts.map +1 -1
- package/dist/structures/individual.d.ts +3 -3
- package/dist/structures/individual.d.ts.map +1 -1
- package/dist/structures/lds-ordinance-detail.d.ts +1 -1
- package/dist/structures/lds-ordinance-detail.d.ts.map +1 -1
- package/dist/structures/lds-spouse-sealing.d.ts +1 -1
- package/dist/structures/lds-spouse-sealing.d.ts.map +1 -1
- package/dist/structures/marriage-date.d.ts +1 -1
- package/dist/structures/marriage-date.d.ts.map +1 -1
- package/dist/structures/multimedia-link.d.ts +1 -1
- package/dist/structures/multimedia-link.d.ts.map +1 -1
- package/dist/structures/non-event.d.ts +1 -1
- package/dist/structures/non-event.d.ts.map +1 -1
- package/dist/structures/note.d.ts +2 -2
- package/dist/structures/note.d.ts.map +1 -1
- package/dist/structures/personal-name-pieces.d.ts +1 -1
- package/dist/structures/personal-name-pieces.d.ts.map +1 -1
- package/dist/structures/personal-name.d.ts +1 -1
- package/dist/structures/personal-name.d.ts.map +1 -1
- package/dist/structures/place.d.ts +1 -1
- package/dist/structures/place.d.ts.map +1 -1
- package/dist/structures/repository.d.ts +1 -1
- package/dist/structures/repository.d.ts.map +1 -1
- package/dist/structures/source-citation.d.ts +1 -1
- package/dist/structures/source-citation.d.ts.map +1 -1
- package/dist/structures/source-repository-citation.d.ts +1 -1
- package/dist/structures/source-repository-citation.d.ts.map +1 -1
- package/dist/structures/source.d.ts +1 -1
- package/dist/structures/source.d.ts.map +1 -1
- package/dist/types/types.d.ts +2 -2
- package/dist/types/types.d.ts.map +1 -1
- package/dist/utils/cache.d.ts +3 -3
- package/dist/utils/cache.d.ts.map +1 -1
- package/dist/utils/date-formatter.d.ts +2 -2
- package/dist/utils/date-formatter.d.ts.map +1 -1
- package/dist/utils/get-family-with.d.ts +3 -3
- package/dist/utils/get-family-with.d.ts.map +1 -1
- package/dist/utils/name-formatter.d.ts +1 -1
- package/dist/utils/name-formatter.d.ts.map +1 -1
- package/dist/utils/parser.d.ts +1 -1
- package/dist/utils/parser.d.ts.map +1 -1
- package/dist/utils/parser.js +0 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"note.d.ts","sourceRoot":"","sources":["../../src/classes/note.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAE7C,OAAO,EAAE,MAAM,EAA6B,MAAM,UAAU,CAAC;AAC7D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAC9C,OAAO,
|
|
1
|
+
{"version":3,"file":"note.d.ts","sourceRoot":"","sources":["../../src/classes/note.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAC;AAE7C,OAAO,EAAE,MAAM,EAA6B,MAAM,UAAU,CAAC;AAC7D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAC9C,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,UAAU,CAAC;AAGzC,qBAAa,UAAW,SAAQ,MAAM,CAAC,MAAM,CAAC;gBAE5C,MAAM,CAAC,EAAE,UAAU,EACnB,EAAE,CAAC,EAAE,MAAM,EACX,IAAI,CAAC,EAAE,MAAM,EACb,MAAM,CAAC,EAAE,MAAM;IAOhB,IAAI,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,EA4BlC;IAED,IAAI,KAAK,IA9BQ,MAAM,GAAG,SAAS,CAyClC;IAED,WAAW;CAGX;AAED,eAAO,MAAM,gBAAgB,GAC5B,SAAS,UAAU,EACnB,KAAK,MAAM,EACX,OAAO,MAAM,EACb,SAAS,MAAM,KACb,aAAa,CAAC,UAAU,CAI1B,CAAC"}
|
package/dist/classes/obje.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type IMultimediaLinkStructure from "../structures/multimedia-link";
|
|
2
|
-
import { type ObjeKey } from "../types/types";
|
|
3
1
|
import type IObje from "../interfaces/obje";
|
|
2
|
+
import type IMultimediaLinkStructure from "../structures/multimedia-link";
|
|
3
|
+
import type { ObjeKey } from "../types/types";
|
|
4
4
|
import { Common } from "./common";
|
|
5
5
|
import type { ProxyOriginal } from "./common";
|
|
6
|
-
import {
|
|
6
|
+
import type { GedComType } from "./gedcom";
|
|
7
7
|
export declare class Obje extends Common<string, ObjeKey> implements IObje {
|
|
8
8
|
standardizeMedia(namespace?: string | number, override?: boolean, urlGetter?: (namespace?: string | number, imgId?: string) => string | undefined): this | ProxyOriginal<ObjeType>;
|
|
9
9
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"obje.d.ts","sourceRoot":"","sources":["../../src/classes/obje.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"obje.d.ts","sourceRoot":"","sources":["../../src/classes/obje.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,oBAAoB,CAAC;AAC5C,OAAO,KAAK,wBAAwB,MAAM,+BAA+B,CAAC;AAC1E,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,gBAAgB,CAAC;AAE5C,OAAO,EAAE,MAAM,EAA6B,MAAM,UAAU,CAAC;AAC7D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAC9C,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,UAAU,CAAC;AAEzC,qBAAa,IAAK,SAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAE,YAAW,KAAK;IACjE,gBAAgB,CACf,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,EAC3B,QAAQ,UAAO,EACf,SAAS,CAAC,EAAE,CACX,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,EAC3B,KAAK,CAAC,EAAE,MAAM,KACV,MAAM,GAAG,SAAS;CAsGxB;AAED,MAAM,MAAM,QAAQ,GAAG,IAAI,GAAG,wBAAwB,CAAC;AACvD,eAAO,MAAM,UAAU,GACtB,QAAQ,UAAU,EAClB,KAAK,OAAO,EACZ,OAAO,MAAM,EACb,SAAS,MAAM,KACb,aAAa,CAAC,QAAQ,CAIxB,CAAC"}
|
package/dist/classes/objes.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { ObjeKey } from "../types/types";
|
|
2
2
|
import { List } from "./list";
|
|
3
|
-
import {
|
|
3
|
+
import type { ObjeType } from "./obje";
|
|
4
4
|
export declare class Objects extends List<ObjeKey, ObjeType> {
|
|
5
5
|
copy(): Objects;
|
|
6
6
|
except(item: ObjeType): Objects;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"objes.d.ts","sourceRoot":"","sources":["../../src/classes/objes.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"objes.d.ts","sourceRoot":"","sources":["../../src/classes/objes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,gBAAgB,CAAC;AAE5C,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,QAAQ,CAAC;AAErC,qBAAa,OAAQ,SAAQ,IAAI,CAAC,OAAO,EAAE,QAAQ,CAAC;IACnD,IAAI;IAUJ,MAAM,CAAC,IAAI,EAAE,QAAQ;CAGrB"}
|
package/dist/classes/repo.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type IRepositoryStructure from "../structures/repository";
|
|
2
|
-
import { type RepoKey } from "../types/types";
|
|
3
1
|
import type IRepo from "../interfaces/repo";
|
|
2
|
+
import type IRepositoryStructure from "../structures/repository";
|
|
3
|
+
import type { RepoKey } from "../types/types";
|
|
4
4
|
import { Common } from "./common";
|
|
5
5
|
import type { ProxyOriginal } from "./common";
|
|
6
|
-
import {
|
|
6
|
+
import type { GedComType } from "./gedcom";
|
|
7
7
|
export declare class Repo extends Common<string, RepoKey> implements IRepo {
|
|
8
8
|
}
|
|
9
9
|
export type RepoType = Repo & IRepositoryStructure;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"repo.d.ts","sourceRoot":"","sources":["../../src/classes/repo.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"repo.d.ts","sourceRoot":"","sources":["../../src/classes/repo.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,oBAAoB,CAAC;AAC5C,OAAO,KAAK,oBAAoB,MAAM,0BAA0B,CAAC;AACjE,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,gBAAgB,CAAC;AAE5C,OAAO,EAAE,MAAM,EAAe,MAAM,UAAU,CAAC;AAC/C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAC9C,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,UAAU,CAAC;AAEzC,qBAAa,IAAK,SAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAE,YAAW,KAAK;CAAG;AAErE,MAAM,MAAM,QAAQ,GAAG,IAAI,GAAG,oBAAoB,CAAC;AACnD,eAAO,MAAM,UAAU,GACtB,QAAQ,UAAU,EAClB,KAAK,OAAO,EACZ,OAAO,MAAM,EACb,SAAS,MAAM,KACb,aAAa,CAAC,QAAQ,CAIxB,CAAC"}
|
package/dist/classes/repos.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { RepoKey } from "../types/types";
|
|
2
2
|
import { List } from "./list";
|
|
3
|
-
import {
|
|
3
|
+
import type { RepoType } from "./repo";
|
|
4
4
|
export declare class Repositories extends List<RepoKey, RepoType> {
|
|
5
5
|
copy(): Repositories;
|
|
6
6
|
except(item: RepoType): Repositories;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"repos.d.ts","sourceRoot":"","sources":["../../src/classes/repos.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"repos.d.ts","sourceRoot":"","sources":["../../src/classes/repos.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,gBAAgB,CAAC;AAE5C,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,QAAQ,CAAC;AAErC,qBAAa,YAAa,SAAQ,IAAI,CAAC,OAAO,EAAE,QAAQ,CAAC;IACxD,IAAI;IAUJ,MAAM,CAAC,IAAI,EAAE,QAAQ;CAGrB"}
|
package/dist/classes/sour.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import type ISourceStructure from "../structures/source";
|
|
2
|
-
import { type SourKey } from "../types/types";
|
|
3
1
|
import type ISour from "../interfaces/sour";
|
|
2
|
+
import type ISourceStructure from "../structures/source";
|
|
3
|
+
import type { SourKey } from "../types/types";
|
|
4
4
|
import { Common } from "./common";
|
|
5
5
|
import type { ProxyOriginal } from "./common";
|
|
6
|
-
import {
|
|
6
|
+
import type { GedComType } from "./gedcom";
|
|
7
7
|
export declare class Sour extends Common<string, SourKey> implements ISour {
|
|
8
8
|
}
|
|
9
9
|
export type SourType = Sour & ISourceStructure;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sour.d.ts","sourceRoot":"","sources":["../../src/classes/sour.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"sour.d.ts","sourceRoot":"","sources":["../../src/classes/sour.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,oBAAoB,CAAC;AAC5C,OAAO,KAAK,gBAAgB,MAAM,sBAAsB,CAAC;AACzD,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,gBAAgB,CAAC;AAE5C,OAAO,EAAE,MAAM,EAAe,MAAM,UAAU,CAAC;AAC/C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAC9C,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,UAAU,CAAC;AAEzC,qBAAa,IAAK,SAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAE,YAAW,KAAK;CAAG;AAErE,MAAM,MAAM,QAAQ,GAAG,IAAI,GAAG,gBAAgB,CAAC;AAC/C,eAAO,MAAM,UAAU,GACtB,QAAQ,UAAU,EAClB,KAAK,OAAO,EACZ,OAAO,MAAM,EACb,SAAS,MAAM,KACb,aAAa,CAAC,QAAQ,CAIxB,CAAC"}
|
package/dist/classes/sours.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { SourKey } from "../types/types";
|
|
2
2
|
import { List } from "./list";
|
|
3
|
-
import {
|
|
3
|
+
import type { SourType } from "./sour";
|
|
4
4
|
export declare class Sources extends List<SourKey, SourType> {
|
|
5
5
|
copy(): Sources;
|
|
6
6
|
except(item: SourType): Sources;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sours.d.ts","sourceRoot":"","sources":["../../src/classes/sours.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"sours.d.ts","sourceRoot":"","sources":["../../src/classes/sours.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,gBAAgB,CAAC;AAE5C,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,QAAQ,CAAC;AAErC,qBAAa,OAAQ,SAAQ,IAAI,CAAC,OAAO,EAAE,QAAQ,CAAC;IACnD,IAAI;IAUJ,MAAM,CAAC,IAAI,EAAE,QAAQ;CAGrB"}
|
package/dist/classes/subm.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { type SubmKey } from "../types/types";
|
|
2
1
|
import type ISubm from "../interfaces/subm";
|
|
2
|
+
import type { SubmKey } from "../types/types";
|
|
3
3
|
import { Common } from "./common";
|
|
4
4
|
import type { ProxyOriginal } from "./common";
|
|
5
|
-
import {
|
|
5
|
+
import type { GedComType } from "./gedcom";
|
|
6
6
|
export declare class Subm extends Common<string, SubmKey> implements ISubm {
|
|
7
7
|
}
|
|
8
8
|
export type SubmType = Subm & ISubm;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subm.d.ts","sourceRoot":"","sources":["../../src/classes/subm.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"subm.d.ts","sourceRoot":"","sources":["../../src/classes/subm.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,oBAAoB,CAAC;AAC5C,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,gBAAgB,CAAC;AAE5C,OAAO,EAAE,MAAM,EAAe,MAAM,UAAU,CAAC;AAC/C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAC9C,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,UAAU,CAAC;AAEzC,qBAAa,IAAK,SAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAE,YAAW,KAAK;CAAG;AAErE,MAAM,MAAM,QAAQ,GAAG,IAAI,GAAG,KAAK,CAAC;AACpC,eAAO,MAAM,UAAU,GACtB,QAAQ,UAAU,EAClB,KAAK,OAAO,EACZ,OAAO,MAAM,EACb,SAAS,MAAM,KACb,aAAa,CAAC,QAAQ,CAIxB,CAAC"}
|
package/dist/classes/subms.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { SubmKey } from "../types/types";
|
|
2
2
|
import { List } from "./list";
|
|
3
|
-
import {
|
|
3
|
+
import type { SubmType } from "./subm";
|
|
4
4
|
export declare class Submitters extends List<SubmKey, SubmType> {
|
|
5
5
|
copy(): Submitters;
|
|
6
6
|
except(item: SubmType): Submitters;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"subms.d.ts","sourceRoot":"","sources":["../../src/classes/subms.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"subms.d.ts","sourceRoot":"","sources":["../../src/classes/subms.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,gBAAgB,CAAC;AAE5C,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,QAAQ,CAAC;AAErC,qBAAa,UAAW,SAAQ,IAAI,CAAC,OAAO,EAAE,QAAQ,CAAC;IACtD,IAAI;IAUJ,MAAM,CAAC,IAAI,EAAE,QAAQ;CAGrB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"convert.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/convert.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"convert.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/convert.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAUzC,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAiF7D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extract.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/extract.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"extract.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/extract.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAczC,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CA4F7D"}
|
|
@@ -16,7 +16,7 @@ export function registerExtractCommand(program) {
|
|
|
16
16
|
try {
|
|
17
17
|
const content = readGedcomFile(file);
|
|
18
18
|
const { gedcom: tree } = GedcomTree.parse(content);
|
|
19
|
-
|
|
19
|
+
const individuals = tree.indis();
|
|
20
20
|
const results = [];
|
|
21
21
|
// Collect individuals that match all filters
|
|
22
22
|
individuals.forEach(indi => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"find.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/find.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"find.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/find.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAqBzC,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CA0G1D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"info.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/info.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"info.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/info.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAiBzC,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAkF1D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"merge.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/merge.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"merge.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/merge.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAwBzC,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAoE3D"}
|
|
@@ -1,90 +1,58 @@
|
|
|
1
1
|
import { writeFileSync } from 'fs';
|
|
2
|
+
import { mergeGedcoms } from '../../classes/gedcom.js';
|
|
2
3
|
import GedcomTree from '../../utils/parser.js';
|
|
3
4
|
import { formatSuccess } from '../utils/formatters.js';
|
|
4
5
|
import { readGedcomFile, handleError } from '../utils/helpers.js';
|
|
6
|
+
/**
|
|
7
|
+
* Helper to get and validate the merge strategy
|
|
8
|
+
*/
|
|
9
|
+
function getMergeStrategy(options) {
|
|
10
|
+
if (options.dedupe) {
|
|
11
|
+
console.warn('Warning: --dedupe option is deprecated. Use --strategy NAME instead.');
|
|
12
|
+
return 'NAME';
|
|
13
|
+
}
|
|
14
|
+
return (options.strategy || 'id');
|
|
15
|
+
}
|
|
5
16
|
export function registerMergeCommand(program) {
|
|
6
17
|
program
|
|
7
18
|
.command('merge <files...>')
|
|
8
19
|
.description('Merge multiple GEDCOM files')
|
|
9
20
|
.requiredOption('-o, --output <file>', 'Output file path (required)')
|
|
10
|
-
.option('--dedupe', 'Attempt to detect and merge duplicates (
|
|
21
|
+
.option('--dedupe', 'Attempt to detect and merge duplicates (deprecated, use --strategy NAME)')
|
|
22
|
+
.option('--strategy <strategy>', 'Matching strategy: "id" (match by ID) or a tag like "NAME" (match by name). Default: "id"', 'id')
|
|
11
23
|
.action((files, options) => {
|
|
12
24
|
try {
|
|
13
25
|
if (files.length < 2) {
|
|
14
26
|
console.error('At least 2 files are required for merging');
|
|
15
27
|
process.exit(1);
|
|
16
28
|
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
const
|
|
24
|
-
const
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
while (seenIds.has(id)) {
|
|
45
|
-
id = `@I${idCounter++}@`;
|
|
46
|
-
}
|
|
47
|
-
seenIds.add(id);
|
|
48
|
-
// Store with original object (we'll need to update ID in output)
|
|
49
|
-
allIndividuals.push({ ...indi, newId: id });
|
|
50
|
-
});
|
|
51
|
-
// Add families with unique IDs
|
|
52
|
-
families.forEach(fam => {
|
|
53
|
-
let id = fam.id;
|
|
54
|
-
while (seenIds.has(id)) {
|
|
55
|
-
id = `@F${idCounter++}@`;
|
|
56
|
-
}
|
|
57
|
-
seenIds.add(id);
|
|
58
|
-
allFamilies.push({ ...fam, newId: id });
|
|
59
|
-
});
|
|
60
|
-
});
|
|
61
|
-
// Create merged GEDCOM
|
|
62
|
-
const lines = [];
|
|
63
|
-
lines.push('0 HEAD');
|
|
64
|
-
lines.push('1 SOUR gedcom-parser CLI');
|
|
65
|
-
lines.push('1 GEDC');
|
|
66
|
-
lines.push('2 VERS 5.5.1');
|
|
67
|
-
lines.push('1 CHAR UTF-8');
|
|
68
|
-
// Add all individuals
|
|
69
|
-
allIndividuals.forEach(indi => {
|
|
70
|
-
const raw = indi.raw?.() || '';
|
|
71
|
-
if (raw) {
|
|
72
|
-
// Replace old ID with new ID if needed
|
|
73
|
-
const updatedRaw = raw.replace(new RegExp(`^0 ${indi.id} INDI`, 'm'), `0 ${indi.newId} INDI`);
|
|
74
|
-
lines.push(...updatedRaw.split('\n').filter(line => line.trim()));
|
|
75
|
-
}
|
|
76
|
-
});
|
|
77
|
-
// Add all families
|
|
78
|
-
allFamilies.forEach(fam => {
|
|
79
|
-
const raw = fam.raw?.() || '';
|
|
80
|
-
if (raw) {
|
|
81
|
-
const updatedRaw = raw.replace(new RegExp(`^0 ${fam.id} FAM`, 'm'), `0 ${fam.newId} FAM`);
|
|
82
|
-
lines.push(...updatedRaw.split('\n').filter(line => line.trim()));
|
|
83
|
-
}
|
|
84
|
-
});
|
|
85
|
-
lines.push('0 TRLR');
|
|
86
|
-
writeFileSync(options.output, lines.join('\n'), 'utf-8');
|
|
87
|
-
console.log(formatSuccess(`Merged ${files.length} files (${allIndividuals.length} individuals, ${allFamilies.length} families) into ${options.output}`));
|
|
29
|
+
// For 2 files, use the new mergeGedcoms function
|
|
30
|
+
if (files.length === 2) {
|
|
31
|
+
const targetContent = readGedcomFile(files[0]);
|
|
32
|
+
const sourceContent = readGedcomFile(files[1]);
|
|
33
|
+
const { gedcom: targetGedcom } = GedcomTree.parse(targetContent);
|
|
34
|
+
const { gedcom: sourceGedcom } = GedcomTree.parse(sourceContent);
|
|
35
|
+
const strategy = getMergeStrategy(options);
|
|
36
|
+
const merged = mergeGedcoms(targetGedcom, sourceGedcom, strategy);
|
|
37
|
+
const mergedContent = merged.toGedcom();
|
|
38
|
+
writeFileSync(options.output, mergedContent, 'utf-8');
|
|
39
|
+
console.log(formatSuccess(`Merged 2 files using strategy "${strategy}" (${merged.indis()?.length} individuals, ${merged.fams()?.length} families) into ${options.output}`));
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
// For more than 2 files, use iterative merging
|
|
43
|
+
console.log(`Merging ${files.length} files iteratively...`);
|
|
44
|
+
const targetContent = readGedcomFile(files[0]);
|
|
45
|
+
let { gedcom: targetGedcom } = GedcomTree.parse(targetContent);
|
|
46
|
+
const strategy = getMergeStrategy(options);
|
|
47
|
+
for (let i = 1; i < files.length; i++) {
|
|
48
|
+
const sourceContent = readGedcomFile(files[i]);
|
|
49
|
+
const { gedcom: sourceGedcom } = GedcomTree.parse(sourceContent);
|
|
50
|
+
targetGedcom = mergeGedcoms(targetGedcom, sourceGedcom, strategy);
|
|
51
|
+
console.log(` Merged file ${i + 1}/${files.length}: ${files[i]}`);
|
|
52
|
+
}
|
|
53
|
+
const mergedContent = targetGedcom.toGedcom();
|
|
54
|
+
writeFileSync(options.output, mergedContent, 'utf-8');
|
|
55
|
+
console.log(formatSuccess(`Merged ${files.length} files (${targetGedcom.indis()?.length} individuals, ${targetGedcom.fams()?.length} families) into ${options.output}`));
|
|
88
56
|
}
|
|
89
57
|
catch (error) {
|
|
90
58
|
handleError(error, 'Failed to merge GEDCOM files');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"relatives.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/relatives.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"relatives.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/relatives.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAsBzC,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAwF/D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"show.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/show.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"show.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/show.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAuBzC,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAiN1D"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stats.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/stats.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"stats.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/stats.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAczC,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CA6D3D"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import GedcomTree from '../../utils/parser.js';
|
|
1
2
|
import { formatHeader, formatLabel, formatCount, formatJson, } from '../utils/formatters.js';
|
|
2
3
|
import { readGedcomFile, handleError } from '../utils/helpers.js';
|
|
3
|
-
import GedcomTree from '../../utils/parser.js';
|
|
4
4
|
export function registerStatsCommand(program) {
|
|
5
5
|
program
|
|
6
6
|
.command('stats <file>')
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/validate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../../../src/cli/commands/validate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA0BzC,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAqK9D"}
|
package/dist/cli/index.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { Command } from 'commander';
|
|
3
2
|
import { readFileSync } from 'fs';
|
|
4
3
|
import { dirname, join } from 'path';
|
|
5
4
|
import { fileURLToPath } from 'url';
|
|
6
|
-
import {
|
|
5
|
+
import { Command } from 'commander';
|
|
6
|
+
import { registerConvertCommand } from './commands/convert.js';
|
|
7
|
+
import { registerExtractCommand } from './commands/extract.js';
|
|
7
8
|
import { registerFindCommand } from './commands/find.js';
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
9
|
+
import { registerInfoCommand } from './commands/info.js';
|
|
10
|
+
import { registerMergeCommand } from './commands/merge.js';
|
|
10
11
|
import { registerRelativesCommand } from './commands/relatives.js';
|
|
11
|
-
import {
|
|
12
|
+
import { registerShowCommand } from './commands/show.js';
|
|
12
13
|
import { registerStatsCommand } from './commands/stats.js';
|
|
13
|
-
import {
|
|
14
|
-
import { registerConvertCommand } from './commands/convert.js';
|
|
14
|
+
import { registerValidateCommand } from './commands/validate.js';
|
|
15
15
|
// Get package version
|
|
16
16
|
const __filename = fileURLToPath(import.meta.url);
|
|
17
17
|
const __dirname = dirname(__filename);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { RelationType, PartnerType } from "../types/types";
|
|
2
|
+
import type { RequiredFilter, Filter } from "../types/types";
|
|
2
3
|
export declare const EVERY: Filter;
|
|
3
4
|
export declare const FEMALE: Filter;
|
|
4
5
|
export declare const MALE: Filter;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filters.d.ts","sourceRoot":"","sources":["../../src/constants/filters.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"filters.d.ts","sourceRoot":"","sources":["../../src/constants/filters.ts"],"names":[],"mappings":"AAAA,OAAO,EAGN,YAAY,EACZ,WAAW,EACX,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAC,cAAc,EAAE,MAAM,EAAC,MAAM,gBAAgB,CAAC;AAE3D,eAAO,MAAM,KAAK,EAAE,MAAW,CAAC;AAEhC,eAAO,MAAM,MAAM,EAAE,MAEpB,CAAC;AAEF,eAAO,MAAM,IAAI,EAAE,MAElB,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,cAAc,CAAC,MAAM,EAAE,YAAY,CAExD,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,cAAc,CAAC,MAAM,EAAE,YAAY,CAEtD,CAAC;AAEF,eAAO,MAAM,MAAM,EAAE,cAAc,CAAC,MAAM,EAAE,YAAY,CAEvD,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,cAAc,CAAC,MAAM,EAAE,YAAY,CAExD,CAAC;AAEF,eAAO,MAAM,IAAI,EAAE,cAAc,CAAC,MAAM,EAAE,YAAY,CAErD,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,cAAc,CAAC,MAAM,EAAE,YAAY,CAE3D,CAAC;AAEF,eAAO,MAAM,MAAM,EAAE,cAAc,CAAC,MAAM,EAAE,WAAW,CAEtD,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,cAAc,CAAC,MAAM,EAAE,WAAW,CAErD,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,cAAc,CAAC,MAAM,EAAE,WAAW,CAEvD,CAAC;AAEF,eAAO,MAAM,MAAM,EAAE,cAAc,CAAC,MAAM,EAAE,WAAW,CAEtD,CAAC;AAEF,eAAO,MAAM,MAAM,EAAE,cAAc,CAAC,MAAM,EAAE,WAAW,CAEtD,CAAC;AAEF,eAAO,MAAM,MAAM,EAAE,cAAc,CAAC,MAAM,EAAE,WAAW,CAEtD,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import type { IndiType } from "../classes/indi";
|
|
2
|
+
import type { OrderIterator, Order, IndiKey, NameOrder } from "../types/types";
|
|
3
3
|
export declare const DEFAULT: Order;
|
|
4
4
|
export declare const BIRTH_ASC: Order;
|
|
5
5
|
export declare const BIRTH_DESC: Order;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"orders.d.ts","sourceRoot":"","sources":["../../src/constants/orders.ts"],"names":[],"mappings":"AACA,OAAO,
|
|
1
|
+
{"version":3,"file":"orders.d.ts","sourceRoot":"","sources":["../../src/constants/orders.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,iBAAiB,CAAC;AAE9C,OAAO,KAAK,EAAC,aAAa,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,EAAC,MAAM,gBAAgB,CAAC;AAG7E,eAAO,MAAM,OAAO,EAAE,KAAU,CAAC;AAEjC,eAAO,MAAM,SAAS,EAAE,KAUvB,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,KAUxB,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,KAUvB,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,KAUxB,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,KAUtB,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,KAUvB,CAAC;AAwGF,eAAO,MAAM,WAAW,EAAE,CACzB,SAAS,CAAC,EAAE,SAAS,KACjB,aAAa,CAAC,QAAQ,EAAE,OAAO,CAgBlC,CAAC;AAEH,eAAO,MAAM,UAAU,EAAE,CACxB,SAAS,CAAC,EAAE,SAAS,KACjB,aAAa,CAAC,QAAQ,EAAE,OAAO,CAgBlC,CAAC;AAEH,eAAO,MAAM,WAAW,EAAE,aAAa,CAAC,QAAQ,EAAE,OAAO,CAyBxD,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,CAChC,SAAS,CAAC,EAAE,SAAS,KACjB,aAAa,CAAC,QAAQ,EAAE,OAAO,CAUlC,CAAC;AAEH,eAAO,MAAM,cAAc,EAAE,CAC5B,MAAM,CAAC,EAAE,OAAO,EAChB,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,KACrB,aAAa,CAAC,QAAQ,EAAE,OAAO,CAsBlC,CAAC;AAEH,eAAO,MAAM,2BAA2B,EAAE,CACzC,MAAM,CAAC,EAAE,OAAO,KACZ,aAAa,CAAC,QAAQ,EAAE,OAAO,CAelC,CAAC;AAEH,eAAO,MAAM,sBAAsB,EAAE,CACpC,MAAM,CAAC,EAAE,OAAO,KACZ,aAAa,CAAC,QAAQ,EAAE,OAAO,CAclC,CAAC"}
|
package/dist/init.d.ts
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Initialize gedcom-parser with custom factories
|
|
3
|
+
* This provides a unified initialization function instead of calling multiple setters
|
|
4
|
+
*/
|
|
5
|
+
import { type CacheManagerFactory, type DateLocaleProvider, type I18nProvider, type KinshipTranslatorConstructor, type PlaceParserFunction, type PlaceTranslatorFunction } from "./index";
|
|
6
|
+
/**
|
|
7
|
+
* Factory configuration options for gedcom-parser initialization
|
|
8
|
+
*/
|
|
9
|
+
export interface GedcomParserFactories {
|
|
10
|
+
/**
|
|
11
|
+
* Date locale provider - returns date-fns Locale for formatting
|
|
12
|
+
* @example () => enUS
|
|
13
|
+
*/
|
|
14
|
+
dateLocaleProvider?: DateLocaleProvider;
|
|
15
|
+
/**
|
|
16
|
+
* i18n translation provider
|
|
17
|
+
* @example (key, options) => i18n.t(key, options)
|
|
18
|
+
*/
|
|
19
|
+
i18nProvider?: I18nProvider;
|
|
20
|
+
/**
|
|
21
|
+
* Cache manager factory for kinship/path caching
|
|
22
|
+
* @example (name, store, type, encrypted) => ({ getItem, setItem })
|
|
23
|
+
*/
|
|
24
|
+
cacheManagerFactory?: CacheManagerFactory;
|
|
25
|
+
/**
|
|
26
|
+
* Kinship translator class (optional override)
|
|
27
|
+
* Uses default KinshipTranslator if not provided
|
|
28
|
+
*/
|
|
29
|
+
kinshipTranslatorClass?: KinshipTranslatorConstructor;
|
|
30
|
+
/**
|
|
31
|
+
* Place parser provider - parses place strings into structured parts
|
|
32
|
+
* @example (place) => [{ parts, town, county, country }]
|
|
33
|
+
*/
|
|
34
|
+
placeParserProvider?: PlaceParserFunction;
|
|
35
|
+
/**
|
|
36
|
+
* Place translator provider - translates place strings with country/city recognition
|
|
37
|
+
* @example (place, level, toReversed) => "Budapest, Hungary"
|
|
38
|
+
*/
|
|
39
|
+
placeTranslatorProvider?: PlaceTranslatorFunction;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Initialize gedcom-parser with custom factory providers
|
|
43
|
+
*
|
|
44
|
+
* This is the recommended way to set up gedcom-parser with your application's
|
|
45
|
+
* dependencies. It replaces the need to call multiple individual setter functions.
|
|
46
|
+
*
|
|
47
|
+
* @param factories - Optional factory providers
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* ```typescript
|
|
51
|
+
* import { initGedcomParser } from '@treeviz/gedcom-parser';
|
|
52
|
+
* import { enUS } from 'date-fns/locale';
|
|
53
|
+
* import i18n from './i18n';
|
|
54
|
+
*
|
|
55
|
+
* initGedcomParser({
|
|
56
|
+
* dateLocaleProvider: () => enUS,
|
|
57
|
+
* i18nProvider: (key, options) => i18n.t(key, options),
|
|
58
|
+
* cacheManagerFactory: (name, store, type, encrypted) => ({
|
|
59
|
+
* getItem: async () => localStorage.getItem(name),
|
|
60
|
+
* setItem: async (value) => localStorage.setItem(name, JSON.stringify(value))
|
|
61
|
+
* })
|
|
62
|
+
* });
|
|
63
|
+
* ```
|
|
64
|
+
*
|
|
65
|
+
* @example Minimal initialization (uses defaults)
|
|
66
|
+
* ```typescript
|
|
67
|
+
* initGedcomParser(); // Uses built-in defaults
|
|
68
|
+
* ```
|
|
69
|
+
*
|
|
70
|
+
* @example With custom place parser
|
|
71
|
+
* ```typescript
|
|
72
|
+
* initGedcomParser({
|
|
73
|
+
* placeParserProvider: (place) => {
|
|
74
|
+
* // Custom place parsing logic
|
|
75
|
+
* return [{ parts: place.split(','), town: '', county: '', country: '' }];
|
|
76
|
+
* }
|
|
77
|
+
* });
|
|
78
|
+
* ```
|
|
79
|
+
*/
|
|
80
|
+
export declare const initGedcomParser: (factories?: GedcomParserFactories) => void;
|
|
81
|
+
/**
|
|
82
|
+
* Check if gedcom-parser has been initialized with custom factories
|
|
83
|
+
* @returns true if any factory has been customized
|
|
84
|
+
*/
|
|
85
|
+
export declare const isGedcomParserInitialized: () => boolean;
|
|
86
|
+
/**
|
|
87
|
+
* Get current factory configuration
|
|
88
|
+
* Useful for debugging or verifying initialization
|
|
89
|
+
*/
|
|
90
|
+
export declare const getGedcomParserFactories: () => Partial<GedcomParserFactories>;
|
|
91
|
+
//# sourceMappingURL=init.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../src/init.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAON,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EACvB,KAAK,YAAY,EACjB,KAAK,4BAA4B,EACjC,KAAK,mBAAmB,EACxB,KAAK,uBAAuB,EAC5B,MAAM,SAAS,CAAC;AAEjB;;GAEG;AACH,MAAM,WAAW,qBAAqB;IACrC;;;OAGG;IACH,kBAAkB,CAAC,EAAE,kBAAkB,CAAC;IAExC;;;OAGG;IACH,YAAY,CAAC,EAAE,YAAY,CAAC;IAE5B;;;OAGG;IACH,mBAAmB,CAAC,EAAE,mBAAmB,CAAC;IAE1C;;;OAGG;IACH,sBAAsB,CAAC,EAAE,4BAA4B,CAAC;IAEtD;;;OAGG;IACH,mBAAmB,CAAC,EAAE,mBAAmB,CAAC;IAE1C;;;OAGG;IACH,uBAAuB,CAAC,EAAE,uBAAuB,CAAC;CAClD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,eAAO,MAAM,gBAAgB,GAAI,YAAY,qBAAqB,KAAG,IAoCpE,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,yBAAyB,QAAO,OAI5C,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,wBAAwB,QAAO,OAAO,CAAC,qBAAqB,CAKxE,CAAC"}
|