@treeviz/gedcom-parser 1.0.15 → 1.0.17
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/index.d.ts +1 -1
- package/dist/classes/index.js +29 -28
- package/dist/cli/index.js +29 -28
- package/dist/constants/index.d.ts +1 -1
- package/dist/constants/index.js +18 -17
- package/dist/factories/index.d.ts +2 -2
- package/dist/factories/index.js +18 -17
- package/dist/{index-BvW-KWJP.d.ts → index-DFTsiD5J.d.ts} +1 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.js +29 -28
- package/dist/interfaces/index.d.ts +1 -1
- package/dist/interfaces/index.js +0 -2
- package/dist/kinship-translator/index.d.ts +2 -2
- package/dist/kinship-translator/index.js +18 -17
- package/dist/{place-parser-RlXCXZ8F.d.ts → place-parser-BsrTDadc.d.ts} +1 -1
- package/dist/structures/index.d.ts +2 -2
- package/dist/structures/index.js +0 -2
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.js +0 -2
- package/dist/utils/index.d.ts +3 -3
- package/dist/utils/index.js +29 -28
- package/package.json +1 -1
- package/dist/classes/index.js.map +0 -1
- package/dist/cli/index.js.map +0 -1
- package/dist/constants/index.js.map +0 -1
- package/dist/factories/index.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/interfaces/index.js.map +0 -1
- package/dist/kinship-translator/index.js.map +0 -1
- package/dist/structures/index.js.map +0 -1
- package/dist/types/index.js.map +0 -1
- package/dist/utils/index.js.map +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export { ACCEPTED_DATE_FORMATS, ACCEPTED_DATE_FORMATS_REGEX, GedcomTree, commonDateFormatter, create, dateFormatter, GedcomTree as default, getAllProp, getFamilyWith, getName, getRawSize, getVersion, hungarianOrdinalize, implemented, isDevelopment, marriageDateFormatter, nameFormatter, notImplemented, noteDateFormatter, ordinalize, placeTranslator, setNestedGroup } from './utils/index.js';
|
|
2
2
|
export { CacheManagerFactory, DateLocaleProvider, I18nProvider, KinshipTranslatorConstructor, PlaceParserFunction, PlaceTranslatorFunction, getCacheManagerFactory, getDateLocale, getI18n, getKinshipTranslatorClass, getPlaceParserProvider, getPlaceTranslatorProvider, i18n, resetCacheManagerFactory, resetDateLocaleProvider, resetI18nProvider, resetKinshipTranslatorClass, resetPlaceParserProvider, resetPlaceTranslatorProvider, setCacheManagerFactory, setDateLocaleProvider, setI18nProvider, setKinshipTranslatorClass, setPlaceParserProvider, setPlaceTranslatorProvider } from './factories/index.js';
|
|
3
|
-
export { C as CacheRelatives, I as ICacheManager, P as PlaceParts, g as getPlaceParts, p as pathCache, a as relativesCache, r as resetRelativesCache } from './place-parser-
|
|
3
|
+
export { C as CacheRelatives, I as ICacheManager, P as PlaceParts, g as getPlaceParts, p as pathCache, a as relativesCache, r as resetRelativesCache } from './place-parser-BsrTDadc.js';
|
|
4
4
|
export { KinshipTranslator, KinshipTranslatorBasic, KinshipTranslatorDE, KinshipTranslatorEN, KinshipTranslatorES, KinshipTranslatorFR, KinshipTranslatorHU, translators } from './kinship-translator/index.js';
|
|
5
|
-
export { C as Cases, ao as Common, az as CommonDate, aQ as CommonName, aS as CommonNote, m as ConvertType, j as CrossCase, k as CrossCases, an as CustomTags, am as Existed, aC as Fam, F as FamKey, aj as FamType, aE as Families, aL as FamilySearchMatch, aM as FamilySearchSource, x as Filter, w as FilterIterator, aF as GedCom, ak as GedComType, a3 as GenealogyMember, b9 as GeneratedIndiMethods, aa as GenerationIndiType, a9 as GenerationSpouseType, D as Group, G as GroupDefinition, H as GroupIterator, E as GroupMarker, bg as IAddress, bh as IAssociation, bi as IChangeDate, b4 as ICommon, bj as ICreationDate, bk as IDate, bl as IEventDetail, bl as IEventDetailStructure, b5 as IFam, b6 as IFamilies, bm as IFamily, b7 as IGedCom, bn as IGedcomStructure, b8 as IIndi, bq as IIndividual, bp as IIndividualEvent, bo as IIndividualEventDetail, bq as IIndividualStructure, ba as IIndividuals, br as ILdsOrdinanceDetail, bs as ILdsSpouseSealing, bb as IList, bt as IMarriageDate, bu as IMultimediaLink, bv as INonEvent, bw as INote, bc as IObje, bx as IPlace, bd as IRepo, by as IRepository, be as ISour, bB as ISource, bz as ISourceCitation, bA as ISourceRepositoryCitation, bf as ISubm, t as IdType, aK as Indi, a5 as IndiGenealogy, ab as IndiGenealogyGenerations, ac as IndiGenealogyResult, n as IndiKey, a6 as IndiMarker, a4 as IndiTree, a1 as IndiType, aO as Individuals, I as KinshipTranslatorInterface, L as Language, V as LinkedPersons, aP as List, v as ListTag, a8 as MemberMain, a7 as MemberSide, M as MultiTag, K as NameOrder, J as NestedGroup, ad as NonNullIndiGenealogyResult, N as NonStandard, aU as Obje, O as ObjeKey, al as ObjeType, aW as Objects, A as Order, z as OrderDefinition, B as OrderIterator, X as PartnerType, af as Path, ae as PathItem, bC as Place, Q as PlaceOrder, bD as PlaceType, P as PrimitiveRange, Z as ProxyOriginal, ai as Queue, ah as QueueItem, Y as Range, R as RangeType, ag as ReducedPath, W as RelationType, aX as Repo, o as RepoKey, $ as RepoType, aZ as Repositories, y as RequiredFilter, l as Settings, a_ as Sour, q as SourKey, _ as SourType, b0 as Sources, S as SplitResult, b1 as Subm, r as SubmKey, a0 as SubmType, b3 as Submitters, u as Tag, T as TagKey, a2 as TreeMember, U as UnknownKey, aq as createCommon, aA as createCommonDate, aR as createCommonName, aT as createCommonNote, aD as createFam, aG as createGedCom, aN as createIndi, aV as createObje, ap as createProxy, aY as createRepo, a$ as createSour, b2 as createSubm, h as extractSeparationYears, e as extractSplitPoints, d as findMatchingRangeForSplitRange, f as fromTuple, g as generateSplitRanges, av as getListTag, bE as getPlaces, aw as getValidKey, at as getValidKeys, au as getValidTag, ay as idGetter, i as inRange, aB as isCommonDate, aH as isGedcomString, ax as isId, a as isIntersectedRange, ar as isOnlyMainProp, b as isRangeContained, as as isValidKey, aJ as mergeGedcoms, p as parseRangeBounds, c as splitOverlappingRanges, s as splitRange, aI as validateGedcomContent } from './index-
|
|
5
|
+
export { C as Cases, ao as Common, az as CommonDate, aQ as CommonName, aS as CommonNote, m as ConvertType, j as CrossCase, k as CrossCases, an as CustomTags, am as Existed, aC as Fam, F as FamKey, aj as FamType, aE as Families, aL as FamilySearchMatch, aM as FamilySearchSource, x as Filter, w as FilterIterator, aF as GedCom, ak as GedComType, a3 as GenealogyMember, b9 as GeneratedIndiMethods, aa as GenerationIndiType, a9 as GenerationSpouseType, D as Group, G as GroupDefinition, H as GroupIterator, E as GroupMarker, bg as IAddress, bh as IAssociation, bi as IChangeDate, b4 as ICommon, bj as ICreationDate, bk as IDate, bl as IEventDetail, bl as IEventDetailStructure, b5 as IFam, b6 as IFamilies, bm as IFamily, b7 as IGedCom, bn as IGedcomStructure, b8 as IIndi, bq as IIndividual, bp as IIndividualEvent, bo as IIndividualEventDetail, bq as IIndividualStructure, ba as IIndividuals, br as ILdsOrdinanceDetail, bs as ILdsSpouseSealing, bb as IList, bt as IMarriageDate, bu as IMultimediaLink, bv as INonEvent, bw as INote, bc as IObje, bx as IPlace, bd as IRepo, by as IRepository, be as ISour, bB as ISource, bz as ISourceCitation, bA as ISourceRepositoryCitation, bf as ISubm, t as IdType, aK as Indi, a5 as IndiGenealogy, ab as IndiGenealogyGenerations, ac as IndiGenealogyResult, n as IndiKey, a6 as IndiMarker, a4 as IndiTree, a1 as IndiType, aO as Individuals, I as KinshipTranslatorInterface, L as Language, V as LinkedPersons, aP as List, v as ListTag, a8 as MemberMain, a7 as MemberSide, M as MultiTag, K as NameOrder, J as NestedGroup, ad as NonNullIndiGenealogyResult, N as NonStandard, aU as Obje, O as ObjeKey, al as ObjeType, aW as Objects, A as Order, z as OrderDefinition, B as OrderIterator, X as PartnerType, af as Path, ae as PathItem, bC as Place, Q as PlaceOrder, bD as PlaceType, P as PrimitiveRange, Z as ProxyOriginal, ai as Queue, ah as QueueItem, Y as Range, R as RangeType, ag as ReducedPath, W as RelationType, aX as Repo, o as RepoKey, $ as RepoType, aZ as Repositories, y as RequiredFilter, l as Settings, a_ as Sour, q as SourKey, _ as SourType, b0 as Sources, S as SplitResult, b1 as Subm, r as SubmKey, a0 as SubmType, b3 as Submitters, u as Tag, T as TagKey, a2 as TreeMember, U as UnknownKey, aq as createCommon, aA as createCommonDate, aR as createCommonName, aT as createCommonNote, aD as createFam, aG as createGedCom, aN as createIndi, aV as createObje, ap as createProxy, aY as createRepo, a$ as createSour, b2 as createSubm, h as extractSeparationYears, e as extractSplitPoints, d as findMatchingRangeForSplitRange, f as fromTuple, g as generateSplitRanges, av as getListTag, bE as getPlaces, aw as getValidKey, at as getValidKeys, au as getValidTag, ay as idGetter, i as inRange, aB as isCommonDate, aH as isGedcomString, ax as isId, a as isIntersectedRange, ar as isOnlyMainProp, b as isRangeContained, as as isValidKey, aJ as mergeGedcoms, p as parseRangeBounds, c as splitOverlappingRanges, s as splitRange, aI as validateGedcomContent } from './index-DFTsiD5J.js';
|
|
6
6
|
export { AncestryMedia } from './types/index.js';
|
|
7
7
|
export { ADOPTED, BIOLOGICAL, BIRTH, BIRTH_ASC, BIRTH_DESC, DATE_ASC, DATE_DESC, DEATH_ASC, DEATH_DESC, DEFAULT, EVERY, FEMALE, FOSTER, FRIEND, ID_GETTER_REG, ID_REG, ID_SPLIT_REG, LINE_REG, MALE, MAX_FILE_SIZE_TO_SYNC, OTHER, PARTNER, REF_LINE_REG, SEALING, SINGLE, SPOUSE, STEP, UNKOWN, getBirthAsc, getMarriageAsc, getMarriageAscAndBirth, getMarriageAscAndChildBirth, getNameAsc, getNameAscAndBirth, getNameDesc } from './constants/index.js';
|
|
8
8
|
export { IPersonalName, IPersonalNamePieces } from './structures/index.js';
|
package/dist/index.js
CHANGED
|
@@ -300,7 +300,7 @@ var List = class _List {
|
|
|
300
300
|
const [key, { getter }] = Object.entries(
|
|
301
301
|
typeof groups === "string" ? { [groups]: {} } : groups
|
|
302
302
|
)[0];
|
|
303
|
-
const raw = item.get(key)?.
|
|
303
|
+
const raw = item.get(key)?.index(0);
|
|
304
304
|
let value = raw?.toValue();
|
|
305
305
|
if (getter && typeof getter === "function") {
|
|
306
306
|
value = getter(value, raw);
|
|
@@ -633,6 +633,9 @@ var Common = class _Common {
|
|
|
633
633
|
this.id ? { [this.id]: this } : { ...[this] }
|
|
634
634
|
);
|
|
635
635
|
}
|
|
636
|
+
index(i) {
|
|
637
|
+
return this.toList()?.index(i);
|
|
638
|
+
}
|
|
636
639
|
toValueList() {
|
|
637
640
|
return new List().concat(
|
|
638
641
|
this.value ? { [this.value]: this } : (
|
|
@@ -1760,7 +1763,7 @@ var Indi = class extends Common {
|
|
|
1760
1763
|
});
|
|
1761
1764
|
}
|
|
1762
1765
|
getGenealogy(onlyStraight = false, showDescendants = false) {
|
|
1763
|
-
const id = this.get("FAMC")?.
|
|
1766
|
+
const id = this.get("FAMC")?.index(0)?.toValue();
|
|
1764
1767
|
if (!id) {
|
|
1765
1768
|
return;
|
|
1766
1769
|
}
|
|
@@ -2253,11 +2256,11 @@ var Indi = class extends Common {
|
|
|
2253
2256
|
return dates.death || void 0;
|
|
2254
2257
|
}
|
|
2255
2258
|
getBirthPlace() {
|
|
2256
|
-
const birthEvent = this.get("BIRT")?.
|
|
2259
|
+
const birthEvent = this.get("BIRT")?.index(0);
|
|
2257
2260
|
return birthEvent?.PLAC?.value;
|
|
2258
2261
|
}
|
|
2259
2262
|
getDeathPlace() {
|
|
2260
|
-
const deathEvent = this.get("DEAT")?.
|
|
2263
|
+
const deathEvent = this.get("DEAT")?.index(0);
|
|
2261
2264
|
return deathEvent?.PLAC?.value;
|
|
2262
2265
|
}
|
|
2263
2266
|
isDead() {
|
|
@@ -3417,7 +3420,7 @@ var nameFormatter = (indiName, settings, letterOnAll = true, indi, debug) => {
|
|
|
3417
3420
|
maxSurnames = 0
|
|
3418
3421
|
} = settings ?? {};
|
|
3419
3422
|
const rawName = indiName instanceof Indi ? indiName?.NAME : createCommonName(void 0, void 0, indi).name(indiName);
|
|
3420
|
-
const name = rawName?.
|
|
3423
|
+
const name = rawName?.index(0);
|
|
3421
3424
|
let givenname = name?.GIVN?.toValueList().first()?.value || "";
|
|
3422
3425
|
let surname = name?.SURN?.toValueList().first()?.value || "";
|
|
3423
3426
|
let suffix = name?.NSFX?.toValueList().first()?.value || "";
|
|
@@ -5470,8 +5473,8 @@ var getNameAsc = (nameOrder = "first-last") => (itemA, _keyA, itemB, _keyB) => {
|
|
|
5470
5473
|
);
|
|
5471
5474
|
};
|
|
5472
5475
|
var getBirthAsc = (itemA, _keyA, itemB, _keyB) => {
|
|
5473
|
-
const birthA = itemA?.BIRT?.
|
|
5474
|
-
const birthB = itemB?.BIRT?.
|
|
5476
|
+
const birthA = itemA?.BIRT?.index(0);
|
|
5477
|
+
const birthB = itemB?.BIRT?.index(0);
|
|
5475
5478
|
const valueA = birthA?.DATE?.rawValue;
|
|
5476
5479
|
const valueB = birthB?.DATE?.rawValue;
|
|
5477
5480
|
if (valueA?.getTime() === valueB?.getTime()) {
|
|
@@ -5613,8 +5616,8 @@ var Individuals = class _Individuals extends List {
|
|
|
5613
5616
|
getFirstEvent() {
|
|
5614
5617
|
const firstBirthPerson = this.getFirstBirth();
|
|
5615
5618
|
const firstDeathPerson = this.getFirstDeath();
|
|
5616
|
-
const firstBirth = firstBirthPerson?.BIRT?.
|
|
5617
|
-
const firstDeath = firstDeathPerson?.DEAT?.
|
|
5619
|
+
const firstBirth = firstBirthPerson?.BIRT?.index(0);
|
|
5620
|
+
const firstDeath = firstDeathPerson?.DEAT?.index(0);
|
|
5618
5621
|
if (!firstBirth?.DATE?.rawValue && !firstDeath?.DATE?.rawValue) {
|
|
5619
5622
|
return void 0;
|
|
5620
5623
|
}
|
|
@@ -5632,8 +5635,8 @@ var Individuals = class _Individuals extends List {
|
|
|
5632
5635
|
getLastEvent() {
|
|
5633
5636
|
const lastDeathPerson = this.getLastDeath();
|
|
5634
5637
|
const lastBirthPerson = this.getLastBirth();
|
|
5635
|
-
const lastBirth = lastBirthPerson?.BIRT?.
|
|
5636
|
-
const lastDeath = lastDeathPerson?.DEAT?.
|
|
5638
|
+
const lastBirth = lastBirthPerson?.BIRT?.index(0);
|
|
5639
|
+
const lastDeath = lastDeathPerson?.DEAT?.index(0);
|
|
5637
5640
|
if (!lastBirth?.DATE?.rawValue && !lastDeath?.DATE?.rawValue) {
|
|
5638
5641
|
return void 0;
|
|
5639
5642
|
}
|
|
@@ -5650,7 +5653,7 @@ var Individuals = class _Individuals extends List {
|
|
|
5650
5653
|
}
|
|
5651
5654
|
getFirstBirth() {
|
|
5652
5655
|
return this.filter((item) => {
|
|
5653
|
-
const birth = item.BIRT?.
|
|
5656
|
+
const birth = item.BIRT?.index(0);
|
|
5654
5657
|
if (birth?.DATE?.rawValue?.getTime() === 0) {
|
|
5655
5658
|
return true;
|
|
5656
5659
|
}
|
|
@@ -5659,7 +5662,7 @@ var Individuals = class _Individuals extends List {
|
|
|
5659
5662
|
}
|
|
5660
5663
|
getLastBirth() {
|
|
5661
5664
|
return this.filter((item) => {
|
|
5662
|
-
const birth = item.BIRT?.
|
|
5665
|
+
const birth = item.BIRT?.index(0);
|
|
5663
5666
|
if (birth?.DATE?.rawValue?.getTime() === 0) {
|
|
5664
5667
|
return true;
|
|
5665
5668
|
}
|
|
@@ -5668,7 +5671,7 @@ var Individuals = class _Individuals extends List {
|
|
|
5668
5671
|
}
|
|
5669
5672
|
getFirstDeath() {
|
|
5670
5673
|
return this.filter((item) => {
|
|
5671
|
-
const death = item.DEAT?.
|
|
5674
|
+
const death = item.DEAT?.index(0);
|
|
5672
5675
|
if (death?.DATE?.rawValue?.getTime() === 0) {
|
|
5673
5676
|
return true;
|
|
5674
5677
|
}
|
|
@@ -5677,7 +5680,7 @@ var Individuals = class _Individuals extends List {
|
|
|
5677
5680
|
}
|
|
5678
5681
|
getLastDeath() {
|
|
5679
5682
|
return this.filter((item) => {
|
|
5680
|
-
const death = item.DEAT?.
|
|
5683
|
+
const death = item.DEAT?.index(0);
|
|
5681
5684
|
if (death?.DATE?.rawValue?.getTime() === 0) {
|
|
5682
5685
|
return true;
|
|
5683
5686
|
}
|
|
@@ -6131,7 +6134,7 @@ var Families = class _Families extends List {
|
|
|
6131
6134
|
// package.json
|
|
6132
6135
|
var package_default = {
|
|
6133
6136
|
name: "@treeviz/gedcom-parser",
|
|
6134
|
-
version: "1.0.
|
|
6137
|
+
version: "1.0.17"};
|
|
6135
6138
|
|
|
6136
6139
|
// src/utils/get-product-details.ts
|
|
6137
6140
|
var isDevelopment = () => {
|
|
@@ -6508,7 +6511,7 @@ var GedCom = class extends Common {
|
|
|
6508
6511
|
});
|
|
6509
6512
|
const surnames = /* @__PURE__ */ new Map();
|
|
6510
6513
|
indis?.forEach((indi) => {
|
|
6511
|
-
const name = indi.NAME?.toValue();
|
|
6514
|
+
const name = indi.NAME?.index(0)?.toValue();
|
|
6512
6515
|
if (name) {
|
|
6513
6516
|
const match = name.match(/\/(.+?)\//);
|
|
6514
6517
|
if (match) {
|
|
@@ -6520,7 +6523,7 @@ var GedCom = class extends Common {
|
|
|
6520
6523
|
const topSurnames = Array.from(surnames.entries()).sort((a, b) => b[1] - a[1]).slice(0, 10).map(([surname, count]) => ({ surname, count }));
|
|
6521
6524
|
const birthPlaces = /* @__PURE__ */ new Map();
|
|
6522
6525
|
indis?.forEach((indi) => {
|
|
6523
|
-
const place = indi.BIRT?.PLAC?.
|
|
6526
|
+
const place = indi.BIRT?.index(0)?.PLAC?.index(0)?.toValue();
|
|
6524
6527
|
if (place) {
|
|
6525
6528
|
birthPlaces.set(place, (birthPlaces.get(place) || 0) + 1);
|
|
6526
6529
|
}
|
|
@@ -6528,14 +6531,14 @@ var GedCom = class extends Common {
|
|
|
6528
6531
|
const topBirthPlaces = Array.from(birthPlaces.entries()).sort((a, b) => b[1] - a[1]).slice(0, 10).map(([place, count]) => ({ place, count }));
|
|
6529
6532
|
const years = [];
|
|
6530
6533
|
indis?.forEach((indi) => {
|
|
6531
|
-
const birthDate = indi.BIRT?.DATE?.toValue();
|
|
6534
|
+
const birthDate = indi.BIRT?.index(0)?.DATE?.index(0)?.toValue();
|
|
6532
6535
|
if (birthDate) {
|
|
6533
6536
|
const match = birthDate.match(/\d{4}/);
|
|
6534
6537
|
if (match) {
|
|
6535
6538
|
years.push(parseInt(match[0], 10));
|
|
6536
6539
|
}
|
|
6537
6540
|
}
|
|
6538
|
-
const deathDate = indi.DEAT?.DATE?.toValue();
|
|
6541
|
+
const deathDate = indi.DEAT?.index(0)?.DATE?.index(0)?.toValue();
|
|
6539
6542
|
if (deathDate) {
|
|
6540
6543
|
const match = deathDate.match(/\d{4}/);
|
|
6541
6544
|
if (match) {
|
|
@@ -6547,8 +6550,8 @@ var GedCom = class extends Common {
|
|
|
6547
6550
|
const maxYear = years.length > 0 ? Math.max(...years) : null;
|
|
6548
6551
|
const lifespans = [];
|
|
6549
6552
|
indis?.forEach((indi) => {
|
|
6550
|
-
const birthDate = indi.BIRT?.DATE?.toValue();
|
|
6551
|
-
const deathDate = indi.DEAT?.DATE?.toValue();
|
|
6553
|
+
const birthDate = indi.BIRT?.index(0)?.DATE?.index(0)?.toValue();
|
|
6554
|
+
const deathDate = indi.DEAT?.index(0)?.DATE?.index(0)?.toValue();
|
|
6552
6555
|
if (birthDate && deathDate) {
|
|
6553
6556
|
const birthMatch = birthDate.match(/\d{4}/);
|
|
6554
6557
|
const deathMatch = deathDate.match(/\d{4}/);
|
|
@@ -6563,8 +6566,8 @@ var GedCom = class extends Common {
|
|
|
6563
6566
|
});
|
|
6564
6567
|
const avgLifespan = lifespans.length > 0 ? lifespans.reduce((sum, age) => sum + age, 0) / lifespans.length : null;
|
|
6565
6568
|
const firstPerson = indis?.getFirstEvent();
|
|
6566
|
-
const firstBirth = firstPerson?.BIRT
|
|
6567
|
-
const firstDeath = firstPerson?.DEAT?.
|
|
6569
|
+
const firstBirth = firstPerson?.BIRT.index(0);
|
|
6570
|
+
const firstDeath = firstPerson?.DEAT?.index(0);
|
|
6568
6571
|
let firstPersonEvent = null;
|
|
6569
6572
|
const firstBirthDate = firstBirth?.DATE?.rawValue;
|
|
6570
6573
|
const firstDeathDate = firstDeath?.DATE?.rawValue;
|
|
@@ -6577,8 +6580,8 @@ var GedCom = class extends Common {
|
|
|
6577
6580
|
};
|
|
6578
6581
|
}
|
|
6579
6582
|
const lastPerson = indis?.getLastEvent();
|
|
6580
|
-
const lastBirth = lastPerson?.BIRT?.
|
|
6581
|
-
const lastDeath = lastPerson?.DEAT?.
|
|
6583
|
+
const lastBirth = lastPerson?.BIRT?.index(0);
|
|
6584
|
+
const lastDeath = lastPerson?.DEAT?.index(0);
|
|
6582
6585
|
let lastPersonEvent = null;
|
|
6583
6586
|
const lastBirthDate = lastBirth?.DATE?.rawValue;
|
|
6584
6587
|
const lastDeathDate = lastDeath?.DATE?.rawValue;
|
|
@@ -7376,5 +7379,3 @@ if (isDev) {
|
|
|
7376
7379
|
var parser_default = GedcomTree;
|
|
7377
7380
|
|
|
7378
7381
|
export { ACCEPTED_DATE_FORMATS, ACCEPTED_DATE_FORMATS_REGEX, ADOPTED, BIOLOGICAL, BIRTH, BIRTH_ASC, BIRTH_DESC, Common, CommonDate, CommonName, CommonNote, CustomTags, DATE_ASC, DATE_DESC, DEATH_ASC, DEATH_DESC, DEFAULT, EVERY, Existed, FEMALE, FOSTER, FRIEND, Fam, Families, GedCom, parser_default as GedcomTree, ID_GETTER_REG, ID_REG, ID_SPLIT_REG, Indi, Individuals, KinshipTranslator, KinshipTranslatorBasic, KinshipTranslatorDe as KinshipTranslatorDE, KinshipTranslatorEn as KinshipTranslatorEN, KinshipTranslatorEs as KinshipTranslatorES, KinshipTranslatorFr as KinshipTranslatorFR, KinshipTranslatorHU, LINE_REG, List, MALE, MAX_FILE_SIZE_TO_SYNC, OTHER, Obje, Objects, PARTNER, PartnerType, PlaceType, REF_LINE_REG, Range, RelationType, Repo, Repositories, SEALING, SINGLE, SPOUSE, STEP, Sour, Sources, Subm, Submitters, UNKOWN, commonDateFormatter, create, createCommon, createCommonDate, createCommonName, createCommonNote, createFam, createGedCom, createIndi, createObje, createProxy, createRepo, createSour, createSubm, dateFormatter, parser_default as default, extractSeparationYears, extractSplitPoints, findMatchingRangeForSplitRange, fromTuple, generateSplitRanges, getAllProp, getBirthAsc, getCacheManagerFactory, getDateLocale, getFamilyWith, getI18n, getKinshipTranslatorClass, getListTag, getMarriageAsc, getMarriageAscAndBirth, getMarriageAscAndChildBirth, getName, getNameAsc, getNameAscAndBirth, getNameDesc, getPlaceParserProvider, getPlaceParts, getPlaceTranslatorProvider, getPlaces, getRawSize, getValidKey, getValidKeys, getValidTag, getVersion, hungarianOrdinalize, i18n, idGetter, implemented, inRange, isCommonDate, isDevelopment, isGedcomString, isId, isIntersectedRange, isOnlyMainProp, isRangeContained, isValidKey, marriageDateFormatter, mergeGedcoms, nameFormatter, notImplemented, noteDateFormatter, ordinalize, parseRangeBounds, pathCache, placeTranslator, relativesCache, resetCacheManagerFactory, resetDateLocaleProvider, resetI18nProvider, resetKinshipTranslatorClass, resetPlaceParserProvider, resetPlaceTranslatorProvider, resetRelativesCache, setCacheManagerFactory, setDateLocaleProvider, setI18nProvider, setKinshipTranslatorClass, setNestedGroup, setPlaceParserProvider, setPlaceTranslatorProvider, splitOverlappingRanges, splitRange, translators_exports as translators, validateGedcomContent };
|
|
7379
|
-
//# sourceMappingURL=index.js.map
|
|
7380
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { b9 as GeneratedIndiMethods, b4 as ICommon, b5 as IFam, b6 as IFamilies, b7 as IGedCom, b8 as IIndi, ba as IIndividuals, bb as IList, bc as IObje, bd as IRepo, be as ISour, bf as ISubm } from '../index-
|
|
1
|
+
export { b9 as GeneratedIndiMethods, b4 as ICommon, b5 as IFam, b6 as IFamilies, b7 as IGedCom, b8 as IIndi, ba as IIndividuals, bb as IList, bc as IObje, bd as IRepo, be as ISour, bf as ISubm } from '../index-DFTsiD5J.js';
|
|
2
2
|
import 'date-fns';
|
package/dist/interfaces/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { I as IKinshipTranslator, af as Path, ae as PathItem, a1 as IndiType, n as IndiKey, L as Language } from '../index-
|
|
2
|
-
export { C as Cases, j as CrossCase, k as CrossCases } from '../index-
|
|
1
|
+
import { I as IKinshipTranslator, af as Path, ae as PathItem, a1 as IndiType, n as IndiKey, L as Language } from '../index-DFTsiD5J.js';
|
|
2
|
+
export { C as Cases, j as CrossCase, k as CrossCases } from '../index-DFTsiD5J.js';
|
|
3
3
|
import 'date-fns';
|
|
4
4
|
|
|
5
5
|
declare class KinshipTranslatorBasic implements IKinshipTranslator {
|
|
@@ -1820,7 +1820,7 @@ var List = class _List {
|
|
|
1820
1820
|
const [key, { getter }] = Object.entries(
|
|
1821
1821
|
typeof groups === "string" ? { [groups]: {} } : groups
|
|
1822
1822
|
)[0];
|
|
1823
|
-
const raw = item.get(key)?.
|
|
1823
|
+
const raw = item.get(key)?.index(0);
|
|
1824
1824
|
let value = raw?.toValue();
|
|
1825
1825
|
if (getter && typeof getter === "function") {
|
|
1826
1826
|
value = getter(value, raw);
|
|
@@ -2153,6 +2153,9 @@ var Common = class _Common {
|
|
|
2153
2153
|
this.id ? { [this.id]: this } : { ...[this] }
|
|
2154
2154
|
);
|
|
2155
2155
|
}
|
|
2156
|
+
index(i) {
|
|
2157
|
+
return this.toList()?.index(i);
|
|
2158
|
+
}
|
|
2156
2159
|
toValueList() {
|
|
2157
2160
|
return new List().concat(
|
|
2158
2161
|
this.value ? { [this.value]: this } : (
|
|
@@ -2712,8 +2715,8 @@ chars.reduce((acc, curr, idx) => {
|
|
|
2712
2715
|
return acc;
|
|
2713
2716
|
}, {});
|
|
2714
2717
|
var getBirthAsc = (itemA, _keyA, itemB, _keyB) => {
|
|
2715
|
-
const birthA = itemA?.BIRT?.
|
|
2716
|
-
const birthB = itemB?.BIRT?.
|
|
2718
|
+
const birthA = itemA?.BIRT?.index(0);
|
|
2719
|
+
const birthB = itemB?.BIRT?.index(0);
|
|
2717
2720
|
const valueA = birthA?.DATE?.rawValue;
|
|
2718
2721
|
const valueB = birthB?.DATE?.rawValue;
|
|
2719
2722
|
if (valueA?.getTime() === valueB?.getTime()) {
|
|
@@ -2964,8 +2967,8 @@ var Individuals = class _Individuals extends List {
|
|
|
2964
2967
|
getFirstEvent() {
|
|
2965
2968
|
const firstBirthPerson = this.getFirstBirth();
|
|
2966
2969
|
const firstDeathPerson = this.getFirstDeath();
|
|
2967
|
-
const firstBirth = firstBirthPerson?.BIRT?.
|
|
2968
|
-
const firstDeath = firstDeathPerson?.DEAT?.
|
|
2970
|
+
const firstBirth = firstBirthPerson?.BIRT?.index(0);
|
|
2971
|
+
const firstDeath = firstDeathPerson?.DEAT?.index(0);
|
|
2969
2972
|
if (!firstBirth?.DATE?.rawValue && !firstDeath?.DATE?.rawValue) {
|
|
2970
2973
|
return void 0;
|
|
2971
2974
|
}
|
|
@@ -2983,8 +2986,8 @@ var Individuals = class _Individuals extends List {
|
|
|
2983
2986
|
getLastEvent() {
|
|
2984
2987
|
const lastDeathPerson = this.getLastDeath();
|
|
2985
2988
|
const lastBirthPerson = this.getLastBirth();
|
|
2986
|
-
const lastBirth = lastBirthPerson?.BIRT?.
|
|
2987
|
-
const lastDeath = lastDeathPerson?.DEAT?.
|
|
2989
|
+
const lastBirth = lastBirthPerson?.BIRT?.index(0);
|
|
2990
|
+
const lastDeath = lastDeathPerson?.DEAT?.index(0);
|
|
2988
2991
|
if (!lastBirth?.DATE?.rawValue && !lastDeath?.DATE?.rawValue) {
|
|
2989
2992
|
return void 0;
|
|
2990
2993
|
}
|
|
@@ -3001,7 +3004,7 @@ var Individuals = class _Individuals extends List {
|
|
|
3001
3004
|
}
|
|
3002
3005
|
getFirstBirth() {
|
|
3003
3006
|
return this.filter((item) => {
|
|
3004
|
-
const birth = item.BIRT?.
|
|
3007
|
+
const birth = item.BIRT?.index(0);
|
|
3005
3008
|
if (birth?.DATE?.rawValue?.getTime() === 0) {
|
|
3006
3009
|
return true;
|
|
3007
3010
|
}
|
|
@@ -3010,7 +3013,7 @@ var Individuals = class _Individuals extends List {
|
|
|
3010
3013
|
}
|
|
3011
3014
|
getLastBirth() {
|
|
3012
3015
|
return this.filter((item) => {
|
|
3013
|
-
const birth = item.BIRT?.
|
|
3016
|
+
const birth = item.BIRT?.index(0);
|
|
3014
3017
|
if (birth?.DATE?.rawValue?.getTime() === 0) {
|
|
3015
3018
|
return true;
|
|
3016
3019
|
}
|
|
@@ -3019,7 +3022,7 @@ var Individuals = class _Individuals extends List {
|
|
|
3019
3022
|
}
|
|
3020
3023
|
getFirstDeath() {
|
|
3021
3024
|
return this.filter((item) => {
|
|
3022
|
-
const death = item.DEAT?.
|
|
3025
|
+
const death = item.DEAT?.index(0);
|
|
3023
3026
|
if (death?.DATE?.rawValue?.getTime() === 0) {
|
|
3024
3027
|
return true;
|
|
3025
3028
|
}
|
|
@@ -3028,7 +3031,7 @@ var Individuals = class _Individuals extends List {
|
|
|
3028
3031
|
}
|
|
3029
3032
|
getLastDeath() {
|
|
3030
3033
|
return this.filter((item) => {
|
|
3031
|
-
const death = item.DEAT?.
|
|
3034
|
+
const death = item.DEAT?.index(0);
|
|
3032
3035
|
if (death?.DATE?.rawValue?.getTime() === 0) {
|
|
3033
3036
|
return true;
|
|
3034
3037
|
}
|
|
@@ -3846,7 +3849,7 @@ var Indi = class extends Common {
|
|
|
3846
3849
|
});
|
|
3847
3850
|
}
|
|
3848
3851
|
getGenealogy(onlyStraight = false, showDescendants = false) {
|
|
3849
|
-
const id = this.get("FAMC")?.
|
|
3852
|
+
const id = this.get("FAMC")?.index(0)?.toValue();
|
|
3850
3853
|
if (!id) {
|
|
3851
3854
|
return;
|
|
3852
3855
|
}
|
|
@@ -4339,11 +4342,11 @@ var Indi = class extends Common {
|
|
|
4339
4342
|
return dates.death || void 0;
|
|
4340
4343
|
}
|
|
4341
4344
|
getBirthPlace() {
|
|
4342
|
-
const birthEvent = this.get("BIRT")?.
|
|
4345
|
+
const birthEvent = this.get("BIRT")?.index(0);
|
|
4343
4346
|
return birthEvent?.PLAC?.value;
|
|
4344
4347
|
}
|
|
4345
4348
|
getDeathPlace() {
|
|
4346
|
-
const deathEvent = this.get("DEAT")?.
|
|
4349
|
+
const deathEvent = this.get("DEAT")?.index(0);
|
|
4347
4350
|
return deathEvent?.PLAC?.value;
|
|
4348
4351
|
}
|
|
4349
4352
|
isDead() {
|
|
@@ -5503,7 +5506,7 @@ var nameFormatter = (indiName, settings, letterOnAll = true, indi, debug) => {
|
|
|
5503
5506
|
maxSurnames = 0
|
|
5504
5507
|
} = settings ?? {};
|
|
5505
5508
|
const rawName = indiName instanceof Indi ? indiName?.NAME : createCommonName(void 0, void 0, indi).name(indiName);
|
|
5506
|
-
const name = rawName?.
|
|
5509
|
+
const name = rawName?.index(0);
|
|
5507
5510
|
let givenname = name?.GIVN?.toValueList().first()?.value || "";
|
|
5508
5511
|
let surname = name?.SURN?.toValueList().first()?.value || "";
|
|
5509
5512
|
let suffix = name?.NSFX?.toValueList().first()?.value || "";
|
|
@@ -5723,5 +5726,3 @@ var KinshipTranslatorDe = class extends KinshipTranslatorBasic {
|
|
|
5723
5726
|
};
|
|
5724
5727
|
|
|
5725
5728
|
export { KinshipTranslator, KinshipTranslatorBasic, KinshipTranslatorDe as KinshipTranslatorDE, KinshipTranslatorEn as KinshipTranslatorEN, KinshipTranslatorEs as KinshipTranslatorES, KinshipTranslatorFr as KinshipTranslatorFR, KinshipTranslatorHU, translators_exports as translators };
|
|
5726
|
-
//# sourceMappingURL=index.js.map
|
|
5727
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ao as Common, bw as INoteStructure, bz as ISourceCitationStructure } from '../index-
|
|
2
|
-
export { bg as IAddress, bh as IAssociation, bi as IChangeDate, bj as ICreationDate, bk as IDate, bl as IEventDetail, bl as IEventDetailStructure, bm as IFamily, bn as IGedcomStructure, bq as IIndividual, bp as IIndividualEvent, bo as IIndividualEventDetail, bq as IIndividualStructure, br as ILdsOrdinanceDetail, bs as ILdsSpouseSealing, bt as IMarriageDate, bu as IMultimediaLink, bv as INonEvent, bx as IPlace, by as IRepository, bB as ISource, bA as ISourceRepositoryCitation } from '../index-
|
|
1
|
+
import { ao as Common, bw as INoteStructure, bz as ISourceCitationStructure } from '../index-DFTsiD5J.js';
|
|
2
|
+
export { bg as IAddress, bh as IAssociation, bi as IChangeDate, bj as ICreationDate, bk as IDate, bl as IEventDetail, bl as IEventDetailStructure, bm as IFamily, bn as IGedcomStructure, bq as IIndividual, bp as IIndividualEvent, bo as IIndividualEventDetail, bq as IIndividualStructure, br as ILdsOrdinanceDetail, bs as ILdsSpouseSealing, bt as IMarriageDate, bu as IMultimediaLink, bv as INonEvent, bx as IPlace, by as IRepository, bB as ISource, bA as ISourceRepositoryCitation } from '../index-DFTsiD5J.js';
|
|
3
3
|
import 'date-fns';
|
|
4
4
|
|
|
5
5
|
interface IPersonalNamePiecesStructure extends Common {
|
package/dist/structures/index.js
CHANGED
package/dist/types/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { m as ConvertType, F as FamKey, x as Filter, w as FilterIterator, D as Group, G as GroupDefinition, H as GroupIterator, E as GroupMarker, t as IdType, n as IndiKey, V as LinkedPersons, v as ListTag, M as MultiTag, K as NameOrder, J as NestedGroup, N as NonStandard, O as ObjeKey, A as Order, z as OrderDefinition, B as OrderIterator, X as PartnerType, Q as PlaceOrder, Y as Range, W as RelationType, o as RepoKey, y as RequiredFilter, l as Settings, q as SourKey, r as SubmKey, u as Tag, T as TagKey, U as UnknownKey } from '../index-
|
|
1
|
+
export { m as ConvertType, F as FamKey, x as Filter, w as FilterIterator, D as Group, G as GroupDefinition, H as GroupIterator, E as GroupMarker, t as IdType, n as IndiKey, V as LinkedPersons, v as ListTag, M as MultiTag, K as NameOrder, J as NestedGroup, N as NonStandard, O as ObjeKey, A as Order, z as OrderDefinition, B as OrderIterator, X as PartnerType, Q as PlaceOrder, Y as Range, W as RelationType, o as RepoKey, y as RequiredFilter, l as Settings, q as SourKey, r as SubmKey, u as Tag, T as TagKey, U as UnknownKey } from '../index-DFTsiD5J.js';
|
|
2
2
|
import 'date-fns';
|
|
3
3
|
|
|
4
4
|
interface AncestryMedia {
|
package/dist/types/index.js
CHANGED
package/dist/utils/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { C as CacheRelatives, I as ICacheManager, P as PlaceParts, g as getPlaceParts, p as pathCache, a as relativesCache, r as resetRelativesCache } from '../place-parser-
|
|
2
|
-
import { l as Settings, ak as GedComType, M as MultiTag, ao as Common, t as IdType, bk as IDateStructure, aj as FamType, az as CommonDate, a1 as IndiType, n as IndiKey, J as NestedGroup, aO as Individuals } from '../index-
|
|
3
|
-
export { bC as Place, bD as PlaceType, P as PrimitiveRange, R as Range, S as SplitResult, h as extractSeparationYears, e as extractSplitPoints, d as findMatchingRangeForSplitRange, f as fromTuple, g as generateSplitRanges, bE as getPlaces, i as inRange, a as isIntersectedRange, b as isRangeContained, p as parseRangeBounds, c as splitOverlappingRanges, s as splitRange } from '../index-
|
|
1
|
+
export { C as CacheRelatives, I as ICacheManager, P as PlaceParts, g as getPlaceParts, p as pathCache, a as relativesCache, r as resetRelativesCache } from '../place-parser-BsrTDadc.js';
|
|
2
|
+
import { l as Settings, ak as GedComType, M as MultiTag, ao as Common, t as IdType, bk as IDateStructure, aj as FamType, az as CommonDate, a1 as IndiType, n as IndiKey, J as NestedGroup, aO as Individuals } from '../index-DFTsiD5J.js';
|
|
3
|
+
export { bC as Place, bD as PlaceType, P as PrimitiveRange, R as Range, S as SplitResult, h as extractSeparationYears, e as extractSplitPoints, d as findMatchingRangeForSplitRange, f as fromTuple, g as generateSplitRanges, bE as getPlaces, i as inRange, a as isIntersectedRange, b as isRangeContained, p as parseRangeBounds, c as splitOverlappingRanges, s as splitRange } from '../index-DFTsiD5J.js';
|
|
4
4
|
import 'date-fns';
|
|
5
5
|
|
|
6
6
|
declare const GedcomTree: {
|
package/dist/utils/index.js
CHANGED
|
@@ -381,7 +381,7 @@ var List = class _List {
|
|
|
381
381
|
const [key, { getter }] = Object.entries(
|
|
382
382
|
typeof groups === "string" ? { [groups]: {} } : groups
|
|
383
383
|
)[0];
|
|
384
|
-
const raw = item.get(key)?.
|
|
384
|
+
const raw = item.get(key)?.index(0);
|
|
385
385
|
let value = raw?.toValue();
|
|
386
386
|
if (getter && typeof getter === "function") {
|
|
387
387
|
value = getter(value, raw);
|
|
@@ -714,6 +714,9 @@ var Common = class _Common {
|
|
|
714
714
|
this.id ? { [this.id]: this } : { ...[this] }
|
|
715
715
|
);
|
|
716
716
|
}
|
|
717
|
+
index(i) {
|
|
718
|
+
return this.toList()?.index(i);
|
|
719
|
+
}
|
|
717
720
|
toValueList() {
|
|
718
721
|
return new List().concat(
|
|
719
722
|
this.value ? { [this.value]: this } : (
|
|
@@ -1172,8 +1175,8 @@ chars.reduce((acc, curr, idx) => {
|
|
|
1172
1175
|
return acc;
|
|
1173
1176
|
}, {});
|
|
1174
1177
|
var getBirthAsc = (itemA, _keyA, itemB, _keyB) => {
|
|
1175
|
-
const birthA = itemA?.BIRT?.
|
|
1176
|
-
const birthB = itemB?.BIRT?.
|
|
1178
|
+
const birthA = itemA?.BIRT?.index(0);
|
|
1179
|
+
const birthB = itemB?.BIRT?.index(0);
|
|
1177
1180
|
const valueA = birthA?.DATE?.rawValue;
|
|
1178
1181
|
const valueB = birthB?.DATE?.rawValue;
|
|
1179
1182
|
if (valueA?.getTime() === valueB?.getTime()) {
|
|
@@ -1585,8 +1588,8 @@ var Individuals = class _Individuals extends List {
|
|
|
1585
1588
|
getFirstEvent() {
|
|
1586
1589
|
const firstBirthPerson = this.getFirstBirth();
|
|
1587
1590
|
const firstDeathPerson = this.getFirstDeath();
|
|
1588
|
-
const firstBirth = firstBirthPerson?.BIRT?.
|
|
1589
|
-
const firstDeath = firstDeathPerson?.DEAT?.
|
|
1591
|
+
const firstBirth = firstBirthPerson?.BIRT?.index(0);
|
|
1592
|
+
const firstDeath = firstDeathPerson?.DEAT?.index(0);
|
|
1590
1593
|
if (!firstBirth?.DATE?.rawValue && !firstDeath?.DATE?.rawValue) {
|
|
1591
1594
|
return void 0;
|
|
1592
1595
|
}
|
|
@@ -1604,8 +1607,8 @@ var Individuals = class _Individuals extends List {
|
|
|
1604
1607
|
getLastEvent() {
|
|
1605
1608
|
const lastDeathPerson = this.getLastDeath();
|
|
1606
1609
|
const lastBirthPerson = this.getLastBirth();
|
|
1607
|
-
const lastBirth = lastBirthPerson?.BIRT?.
|
|
1608
|
-
const lastDeath = lastDeathPerson?.DEAT?.
|
|
1610
|
+
const lastBirth = lastBirthPerson?.BIRT?.index(0);
|
|
1611
|
+
const lastDeath = lastDeathPerson?.DEAT?.index(0);
|
|
1609
1612
|
if (!lastBirth?.DATE?.rawValue && !lastDeath?.DATE?.rawValue) {
|
|
1610
1613
|
return void 0;
|
|
1611
1614
|
}
|
|
@@ -1622,7 +1625,7 @@ var Individuals = class _Individuals extends List {
|
|
|
1622
1625
|
}
|
|
1623
1626
|
getFirstBirth() {
|
|
1624
1627
|
return this.filter((item) => {
|
|
1625
|
-
const birth = item.BIRT?.
|
|
1628
|
+
const birth = item.BIRT?.index(0);
|
|
1626
1629
|
if (birth?.DATE?.rawValue?.getTime() === 0) {
|
|
1627
1630
|
return true;
|
|
1628
1631
|
}
|
|
@@ -1631,7 +1634,7 @@ var Individuals = class _Individuals extends List {
|
|
|
1631
1634
|
}
|
|
1632
1635
|
getLastBirth() {
|
|
1633
1636
|
return this.filter((item) => {
|
|
1634
|
-
const birth = item.BIRT?.
|
|
1637
|
+
const birth = item.BIRT?.index(0);
|
|
1635
1638
|
if (birth?.DATE?.rawValue?.getTime() === 0) {
|
|
1636
1639
|
return true;
|
|
1637
1640
|
}
|
|
@@ -1640,7 +1643,7 @@ var Individuals = class _Individuals extends List {
|
|
|
1640
1643
|
}
|
|
1641
1644
|
getFirstDeath() {
|
|
1642
1645
|
return this.filter((item) => {
|
|
1643
|
-
const death = item.DEAT?.
|
|
1646
|
+
const death = item.DEAT?.index(0);
|
|
1644
1647
|
if (death?.DATE?.rawValue?.getTime() === 0) {
|
|
1645
1648
|
return true;
|
|
1646
1649
|
}
|
|
@@ -1649,7 +1652,7 @@ var Individuals = class _Individuals extends List {
|
|
|
1649
1652
|
}
|
|
1650
1653
|
getLastDeath() {
|
|
1651
1654
|
return this.filter((item) => {
|
|
1652
|
-
const death = item.DEAT?.
|
|
1655
|
+
const death = item.DEAT?.index(0);
|
|
1653
1656
|
if (death?.DATE?.rawValue?.getTime() === 0) {
|
|
1654
1657
|
return true;
|
|
1655
1658
|
}
|
|
@@ -2472,7 +2475,7 @@ var Indi = class extends Common {
|
|
|
2472
2475
|
});
|
|
2473
2476
|
}
|
|
2474
2477
|
getGenealogy(onlyStraight = false, showDescendants = false) {
|
|
2475
|
-
const id = this.get("FAMC")?.
|
|
2478
|
+
const id = this.get("FAMC")?.index(0)?.toValue();
|
|
2476
2479
|
if (!id) {
|
|
2477
2480
|
return;
|
|
2478
2481
|
}
|
|
@@ -2965,11 +2968,11 @@ var Indi = class extends Common {
|
|
|
2965
2968
|
return dates.death || void 0;
|
|
2966
2969
|
}
|
|
2967
2970
|
getBirthPlace() {
|
|
2968
|
-
const birthEvent = this.get("BIRT")?.
|
|
2971
|
+
const birthEvent = this.get("BIRT")?.index(0);
|
|
2969
2972
|
return birthEvent?.PLAC?.value;
|
|
2970
2973
|
}
|
|
2971
2974
|
getDeathPlace() {
|
|
2972
|
-
const deathEvent = this.get("DEAT")?.
|
|
2975
|
+
const deathEvent = this.get("DEAT")?.index(0);
|
|
2973
2976
|
return deathEvent?.PLAC?.value;
|
|
2974
2977
|
}
|
|
2975
2978
|
isDead() {
|
|
@@ -4129,7 +4132,7 @@ var nameFormatter = (indiName, settings, letterOnAll = true, indi, debug) => {
|
|
|
4129
4132
|
maxSurnames = 0
|
|
4130
4133
|
} = settings ?? {};
|
|
4131
4134
|
const rawName = indiName instanceof Indi ? indiName?.NAME : createCommonName(void 0, void 0, indi).name(indiName);
|
|
4132
|
-
const name = rawName?.
|
|
4135
|
+
const name = rawName?.index(0);
|
|
4133
4136
|
let givenname = name?.GIVN?.toValueList().first()?.value || "";
|
|
4134
4137
|
let surname = name?.SURN?.toValueList().first()?.value || "";
|
|
4135
4138
|
let suffix = name?.NSFX?.toValueList().first()?.value || "";
|
|
@@ -5967,7 +5970,7 @@ var isCommonDate = (value) => {
|
|
|
5967
5970
|
// package.json
|
|
5968
5971
|
var package_default = {
|
|
5969
5972
|
name: "@treeviz/gedcom-parser",
|
|
5970
|
-
version: "1.0.
|
|
5973
|
+
version: "1.0.17"};
|
|
5971
5974
|
|
|
5972
5975
|
// src/utils/get-product-details.ts
|
|
5973
5976
|
var isDevelopment = () => {
|
|
@@ -6344,7 +6347,7 @@ var GedCom = class extends Common {
|
|
|
6344
6347
|
});
|
|
6345
6348
|
const surnames = /* @__PURE__ */ new Map();
|
|
6346
6349
|
indis?.forEach((indi) => {
|
|
6347
|
-
const name = indi.NAME?.toValue();
|
|
6350
|
+
const name = indi.NAME?.index(0)?.toValue();
|
|
6348
6351
|
if (name) {
|
|
6349
6352
|
const match = name.match(/\/(.+?)\//);
|
|
6350
6353
|
if (match) {
|
|
@@ -6356,7 +6359,7 @@ var GedCom = class extends Common {
|
|
|
6356
6359
|
const topSurnames = Array.from(surnames.entries()).sort((a, b) => b[1] - a[1]).slice(0, 10).map(([surname, count]) => ({ surname, count }));
|
|
6357
6360
|
const birthPlaces = /* @__PURE__ */ new Map();
|
|
6358
6361
|
indis?.forEach((indi) => {
|
|
6359
|
-
const place = indi.BIRT?.PLAC?.
|
|
6362
|
+
const place = indi.BIRT?.index(0)?.PLAC?.index(0)?.toValue();
|
|
6360
6363
|
if (place) {
|
|
6361
6364
|
birthPlaces.set(place, (birthPlaces.get(place) || 0) + 1);
|
|
6362
6365
|
}
|
|
@@ -6364,14 +6367,14 @@ var GedCom = class extends Common {
|
|
|
6364
6367
|
const topBirthPlaces = Array.from(birthPlaces.entries()).sort((a, b) => b[1] - a[1]).slice(0, 10).map(([place, count]) => ({ place, count }));
|
|
6365
6368
|
const years = [];
|
|
6366
6369
|
indis?.forEach((indi) => {
|
|
6367
|
-
const birthDate = indi.BIRT?.DATE?.toValue();
|
|
6370
|
+
const birthDate = indi.BIRT?.index(0)?.DATE?.index(0)?.toValue();
|
|
6368
6371
|
if (birthDate) {
|
|
6369
6372
|
const match = birthDate.match(/\d{4}/);
|
|
6370
6373
|
if (match) {
|
|
6371
6374
|
years.push(parseInt(match[0], 10));
|
|
6372
6375
|
}
|
|
6373
6376
|
}
|
|
6374
|
-
const deathDate = indi.DEAT?.DATE?.toValue();
|
|
6377
|
+
const deathDate = indi.DEAT?.index(0)?.DATE?.index(0)?.toValue();
|
|
6375
6378
|
if (deathDate) {
|
|
6376
6379
|
const match = deathDate.match(/\d{4}/);
|
|
6377
6380
|
if (match) {
|
|
@@ -6383,8 +6386,8 @@ var GedCom = class extends Common {
|
|
|
6383
6386
|
const maxYear = years.length > 0 ? Math.max(...years) : null;
|
|
6384
6387
|
const lifespans = [];
|
|
6385
6388
|
indis?.forEach((indi) => {
|
|
6386
|
-
const birthDate = indi.BIRT?.DATE?.toValue();
|
|
6387
|
-
const deathDate = indi.DEAT?.DATE?.toValue();
|
|
6389
|
+
const birthDate = indi.BIRT?.index(0)?.DATE?.index(0)?.toValue();
|
|
6390
|
+
const deathDate = indi.DEAT?.index(0)?.DATE?.index(0)?.toValue();
|
|
6388
6391
|
if (birthDate && deathDate) {
|
|
6389
6392
|
const birthMatch = birthDate.match(/\d{4}/);
|
|
6390
6393
|
const deathMatch = deathDate.match(/\d{4}/);
|
|
@@ -6399,8 +6402,8 @@ var GedCom = class extends Common {
|
|
|
6399
6402
|
});
|
|
6400
6403
|
const avgLifespan = lifespans.length > 0 ? lifespans.reduce((sum, age) => sum + age, 0) / lifespans.length : null;
|
|
6401
6404
|
const firstPerson = indis?.getFirstEvent();
|
|
6402
|
-
const firstBirth = firstPerson?.BIRT
|
|
6403
|
-
const firstDeath = firstPerson?.DEAT?.
|
|
6405
|
+
const firstBirth = firstPerson?.BIRT.index(0);
|
|
6406
|
+
const firstDeath = firstPerson?.DEAT?.index(0);
|
|
6404
6407
|
let firstPersonEvent = null;
|
|
6405
6408
|
const firstBirthDate = firstBirth?.DATE?.rawValue;
|
|
6406
6409
|
const firstDeathDate = firstDeath?.DATE?.rawValue;
|
|
@@ -6413,8 +6416,8 @@ var GedCom = class extends Common {
|
|
|
6413
6416
|
};
|
|
6414
6417
|
}
|
|
6415
6418
|
const lastPerson = indis?.getLastEvent();
|
|
6416
|
-
const lastBirth = lastPerson?.BIRT?.
|
|
6417
|
-
const lastDeath = lastPerson?.DEAT?.
|
|
6419
|
+
const lastBirth = lastPerson?.BIRT?.index(0);
|
|
6420
|
+
const lastDeath = lastPerson?.DEAT?.index(0);
|
|
6418
6421
|
let lastPersonEvent = null;
|
|
6419
6422
|
const lastBirthDate = lastBirth?.DATE?.rawValue;
|
|
6420
6423
|
const lastDeathDate = lastDeath?.DATE?.rawValue;
|
|
@@ -6949,5 +6952,3 @@ if (isDev) {
|
|
|
6949
6952
|
var parser_default = GedcomTree;
|
|
6950
6953
|
|
|
6951
6954
|
export { ACCEPTED_DATE_FORMATS, ACCEPTED_DATE_FORMATS_REGEX, parser_default as GedcomTree, PlaceType, commonDateFormatter, create, dateFormatter, extractSeparationYears, extractSplitPoints, findMatchingRangeForSplitRange, fromTuple, generateSplitRanges, getAllProp, getFamilyWith, getName, getPlaceParts, getPlaces, getRawSize, getVersion, hungarianOrdinalize, implemented, inRange, isDevelopment, isIntersectedRange, isRangeContained, marriageDateFormatter, nameFormatter, notImplemented, noteDateFormatter, ordinalize, parseRangeBounds, pathCache, placeTranslator, relativesCache, resetRelativesCache, setNestedGroup, splitOverlappingRanges, splitRange };
|
|
6952
|
-
//# sourceMappingURL=index.js.map
|
|
6953
|
-
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@treeviz/gedcom-parser",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.17",
|
|
4
4
|
"description": "Lightweight, pluggable GEDCOM parser for JavaScript/TypeScript with optional caching and place matching. Zero browser dependencies.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|