@treeviz/gedcom-parser 1.0.13 → 1.0.15
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 +2 -28
- package/dist/classes/index.js +6713 -21
- package/dist/classes/index.js.map +1 -0
- package/dist/cli/index.d.ts +0 -2
- package/dist/cli/index.js +7826 -24
- package/dist/cli/index.js.map +1 -0
- package/dist/constants/index.d.ts +49 -4
- package/dist/constants/index.js +5797 -4
- package/dist/constants/index.js.map +1 -0
- package/dist/factories/index.d.ts +202 -13
- package/dist/factories/index.js +5782 -8
- package/dist/factories/index.js.map +1 -0
- package/dist/index-BvW-KWJP.d.ts +1654 -0
- package/dist/index.d.ts +9 -28
- package/dist/index.js +7380 -35
- package/dist/index.js.map +1 -0
- package/dist/interfaces/index.d.ts +2 -12
- package/dist/interfaces/index.js +3 -1
- package/dist/interfaces/index.js.map +1 -0
- package/dist/kinship-translator/index.d.ts +146 -11
- package/dist/kinship-translator/index.js +5727 -9
- package/dist/kinship-translator/index.js.map +1 -0
- package/dist/place-parser-RlXCXZ8F.d.ts +37 -0
- package/dist/structures/index.d.ts +25 -27
- package/dist/structures/index.js +3 -1
- package/dist/structures/index.js.map +1 -0
- package/dist/types/index.d.ts +69 -8
- package/dist/types/index.js +31 -6
- package/dist/types/index.js.map +1 -0
- package/dist/utils/index.d.ts +91 -18
- package/dist/utils/index.js +6953 -17
- package/dist/utils/index.js.map +1 -0
- package/package.json +4 -3
- package/dist/classes/common.d.ts +0 -91
- package/dist/classes/common.d.ts.map +0 -1
- package/dist/classes/common.js +0 -488
- package/dist/classes/date.d.ts +0 -27
- package/dist/classes/date.d.ts.map +0 -1
- package/dist/classes/date.js +0 -178
- package/dist/classes/fam.d.ts +0 -19
- package/dist/classes/fam.d.ts.map +0 -1
- package/dist/classes/fam.js +0 -38
- package/dist/classes/fams.d.ts +0 -16
- package/dist/classes/fams.d.ts.map +0 -1
- package/dist/classes/fams.js +0 -41
- package/dist/classes/gedcom.d.ts +0 -139
- package/dist/classes/gedcom.d.ts.map +0 -1
- package/dist/classes/gedcom.js +0 -910
- package/dist/classes/index.d.ts.map +0 -1
- package/dist/classes/indi.d.ts +0 -323
- package/dist/classes/indi.d.ts.map +0 -1
- package/dist/classes/indi.js +0 -2131
- package/dist/classes/indis.d.ts +0 -55
- package/dist/classes/indis.d.ts.map +0 -1
- package/dist/classes/indis.js +0 -457
- package/dist/classes/list.d.ts +0 -55
- package/dist/classes/list.d.ts.map +0 -1
- package/dist/classes/list.js +0 -440
- package/dist/classes/name.d.ts +0 -20
- package/dist/classes/name.d.ts.map +0 -1
- package/dist/classes/name.js +0 -48
- package/dist/classes/note.d.ts +0 -12
- package/dist/classes/note.d.ts.map +0 -1
- package/dist/classes/note.js +0 -46
- package/dist/classes/obje.d.ts +0 -12
- package/dist/classes/obje.d.ts.map +0 -1
- package/dist/classes/obje.js +0 -81
- package/dist/classes/objes.d.ts +0 -8
- package/dist/classes/objes.d.ts.map +0 -1
- package/dist/classes/objes.js +0 -13
- package/dist/classes/repo.d.ts +0 -11
- package/dist/classes/repo.d.ts.map +0 -1
- package/dist/classes/repo.js +0 -6
- package/dist/classes/repos.d.ts +0 -8
- package/dist/classes/repos.d.ts.map +0 -1
- package/dist/classes/repos.js +0 -13
- package/dist/classes/sour.d.ts +0 -11
- package/dist/classes/sour.d.ts.map +0 -1
- package/dist/classes/sour.js +0 -6
- package/dist/classes/sours.d.ts +0 -8
- package/dist/classes/sours.d.ts.map +0 -1
- package/dist/classes/sours.js +0 -13
- package/dist/classes/subm.d.ts +0 -10
- package/dist/classes/subm.d.ts.map +0 -1
- package/dist/classes/subm.js +0 -6
- package/dist/classes/subms.d.ts +0 -8
- package/dist/classes/subms.d.ts.map +0 -1
- package/dist/classes/subms.js +0 -13
- package/dist/cli/commands/convert.d.ts +0 -3
- package/dist/cli/commands/convert.d.ts.map +0 -1
- package/dist/cli/commands/convert.js +0 -83
- package/dist/cli/commands/extract.d.ts +0 -3
- package/dist/cli/commands/extract.d.ts.map +0 -1
- package/dist/cli/commands/extract.js +0 -85
- package/dist/cli/commands/find.d.ts +0 -3
- package/dist/cli/commands/find.d.ts.map +0 -1
- package/dist/cli/commands/find.js +0 -97
- package/dist/cli/commands/info.d.ts +0 -3
- package/dist/cli/commands/info.d.ts.map +0 -1
- package/dist/cli/commands/info.js +0 -80
- package/dist/cli/commands/merge.d.ts +0 -3
- package/dist/cli/commands/merge.d.ts.map +0 -1
- package/dist/cli/commands/merge.js +0 -61
- package/dist/cli/commands/relatives.d.ts +0 -3
- package/dist/cli/commands/relatives.d.ts.map +0 -1
- package/dist/cli/commands/relatives.js +0 -107
- package/dist/cli/commands/show.d.ts +0 -3
- package/dist/cli/commands/show.d.ts.map +0 -1
- package/dist/cli/commands/show.js +0 -176
- package/dist/cli/commands/stats.d.ts +0 -3
- package/dist/cli/commands/stats.d.ts.map +0 -1
- package/dist/cli/commands/stats.js +0 -59
- package/dist/cli/commands/validate.d.ts +0 -3
- package/dist/cli/commands/validate.d.ts.map +0 -1
- package/dist/cli/commands/validate.js +0 -148
- package/dist/cli/index.d.ts.map +0 -1
- package/dist/cli/utils/formatters.d.ts +0 -69
- package/dist/cli/utils/formatters.d.ts.map +0 -1
- package/dist/cli/utils/formatters.js +0 -125
- package/dist/cli/utils/helpers.d.ts +0 -21
- package/dist/cli/utils/helpers.d.ts.map +0 -1
- package/dist/cli/utils/helpers.js +0 -58
- package/dist/constants/constants.d.ts +0 -14
- package/dist/constants/constants.d.ts.map +0 -1
- package/dist/constants/constants.js +0 -13
- package/dist/constants/filters.d.ts +0 -18
- package/dist/constants/filters.d.ts.map +0 -1
- package/dist/constants/filters.js +0 -44
- package/dist/constants/index.d.ts.map +0 -1
- package/dist/constants/orders.d.ts +0 -17
- package/dist/constants/orders.d.ts.map +0 -1
- package/dist/constants/orders.js +0 -240
- package/dist/factories/cache-factory.d.ts +0 -30
- package/dist/factories/cache-factory.d.ts.map +0 -1
- package/dist/factories/cache-factory.js +0 -43
- package/dist/factories/date-locale-factory.d.ts +0 -30
- package/dist/factories/date-locale-factory.d.ts.map +0 -1
- package/dist/factories/date-locale-factory.js +0 -34
- package/dist/factories/i18n-factory.d.ts +0 -40
- package/dist/factories/i18n-factory.d.ts.map +0 -1
- package/dist/factories/i18n-factory.js +0 -44
- package/dist/factories/index.d.ts.map +0 -1
- package/dist/factories/kinship-factory.d.ts +0 -38
- package/dist/factories/kinship-factory.d.ts.map +0 -1
- package/dist/factories/kinship-factory.js +0 -35
- package/dist/factories/place-parser-provider.d.ts +0 -32
- package/dist/factories/place-parser-provider.d.ts.map +0 -1
- package/dist/factories/place-parser-provider.js +0 -35
- package/dist/factories/place-translator-provider.d.ts +0 -32
- package/dist/factories/place-translator-provider.d.ts.map +0 -1
- package/dist/factories/place-translator-provider.js +0 -35
- package/dist/index.d.ts.map +0 -1
- package/dist/interfaces/common.d.ts +0 -43
- package/dist/interfaces/common.d.ts.map +0 -1
- package/dist/interfaces/common.js +0 -1
- package/dist/interfaces/fam.d.ts +0 -11
- package/dist/interfaces/fam.d.ts.map +0 -1
- package/dist/interfaces/fam.js +0 -1
- package/dist/interfaces/fams.d.ts +0 -9
- package/dist/interfaces/fams.d.ts.map +0 -1
- package/dist/interfaces/fams.js +0 -1
- package/dist/interfaces/gedcom.d.ts +0 -30
- package/dist/interfaces/gedcom.d.ts.map +0 -1
- package/dist/interfaces/gedcom.js +0 -1
- package/dist/interfaces/index.d.ts.map +0 -1
- package/dist/interfaces/indi.d.ts +0 -113
- package/dist/interfaces/indi.d.ts.map +0 -1
- package/dist/interfaces/indi.js +0 -1
- package/dist/interfaces/indis.d.ts +0 -31
- package/dist/interfaces/indis.d.ts.map +0 -1
- package/dist/interfaces/indis.js +0 -1
- package/dist/interfaces/list.d.ts +0 -52
- package/dist/interfaces/list.d.ts.map +0 -1
- package/dist/interfaces/list.js +0 -1
- package/dist/interfaces/obje.d.ts +0 -7
- package/dist/interfaces/obje.d.ts.map +0 -1
- package/dist/interfaces/obje.js +0 -1
- package/dist/interfaces/repo.d.ts +0 -7
- package/dist/interfaces/repo.d.ts.map +0 -1
- package/dist/interfaces/repo.js +0 -1
- package/dist/interfaces/sour.d.ts +0 -7
- package/dist/interfaces/sour.d.ts.map +0 -1
- package/dist/interfaces/sour.js +0 -1
- package/dist/interfaces/subm.d.ts +0 -6
- package/dist/interfaces/subm.d.ts.map +0 -1
- package/dist/interfaces/subm.js +0 -1
- package/dist/kinship-translator/index.d.ts.map +0 -1
- package/dist/kinship-translator/kinship-translator.basic.d.ts +0 -30
- package/dist/kinship-translator/kinship-translator.basic.d.ts.map +0 -1
- package/dist/kinship-translator/kinship-translator.basic.js +0 -74
- package/dist/kinship-translator/kinship-translator.d.ts +0 -26
- package/dist/kinship-translator/kinship-translator.d.ts.map +0 -1
- package/dist/kinship-translator/kinship-translator.de.d.ts +0 -18
- package/dist/kinship-translator/kinship-translator.de.d.ts.map +0 -1
- package/dist/kinship-translator/kinship-translator.de.js +0 -180
- package/dist/kinship-translator/kinship-translator.en.d.ts +0 -18
- package/dist/kinship-translator/kinship-translator.en.d.ts.map +0 -1
- package/dist/kinship-translator/kinship-translator.en.js +0 -182
- package/dist/kinship-translator/kinship-translator.es.d.ts +0 -18
- package/dist/kinship-translator/kinship-translator.es.d.ts.map +0 -1
- package/dist/kinship-translator/kinship-translator.es.js +0 -181
- package/dist/kinship-translator/kinship-translator.fr.d.ts +0 -18
- package/dist/kinship-translator/kinship-translator.fr.d.ts.map +0 -1
- package/dist/kinship-translator/kinship-translator.fr.js +0 -181
- package/dist/kinship-translator/kinship-translator.hu.d.ts +0 -19
- package/dist/kinship-translator/kinship-translator.hu.d.ts.map +0 -1
- package/dist/kinship-translator/kinship-translator.hu.js +0 -226
- package/dist/kinship-translator/kinship-translator.interface.d.ts +0 -19
- package/dist/kinship-translator/kinship-translator.interface.d.ts.map +0 -1
- package/dist/kinship-translator/kinship-translator.interface.js +0 -1
- package/dist/kinship-translator/kinship-translator.js +0 -103
- package/dist/kinship-translator/patterns.de.d.ts +0 -2
- package/dist/kinship-translator/patterns.de.d.ts.map +0 -1
- package/dist/kinship-translator/patterns.de.js +0 -14
- package/dist/kinship-translator/patterns.en.d.ts +0 -2
- package/dist/kinship-translator/patterns.en.d.ts.map +0 -1
- package/dist/kinship-translator/patterns.en.js +0 -14
- package/dist/kinship-translator/patterns.es.d.ts +0 -2
- package/dist/kinship-translator/patterns.es.d.ts.map +0 -1
- package/dist/kinship-translator/patterns.es.js +0 -14
- package/dist/kinship-translator/patterns.fr.d.ts +0 -2
- package/dist/kinship-translator/patterns.fr.d.ts.map +0 -1
- package/dist/kinship-translator/patterns.fr.js +0 -14
- package/dist/kinship-translator/patterns.hu.d.ts +0 -6
- package/dist/kinship-translator/patterns.hu.d.ts.map +0 -1
- package/dist/kinship-translator/patterns.hu.js +0 -97
- package/dist/kinship-translator/translators.d.ts +0 -6
- package/dist/kinship-translator/translators.d.ts.map +0 -1
- package/dist/kinship-translator/translators.js +0 -5
- package/dist/kinship-translator/types.d.ts +0 -9
- package/dist/kinship-translator/types.d.ts.map +0 -1
- package/dist/kinship-translator/types.js +0 -1
- package/dist/structures/address.d.ts +0 -14
- package/dist/structures/address.d.ts.map +0 -1
- package/dist/structures/address.js +0 -1
- package/dist/structures/association.d.ts +0 -13
- package/dist/structures/association.d.ts.map +0 -1
- package/dist/structures/association.js +0 -1
- package/dist/structures/change-date.d.ts +0 -8
- package/dist/structures/change-date.d.ts.map +0 -1
- package/dist/structures/change-date.js +0 -1
- package/dist/structures/creation-date.d.ts +0 -7
- package/dist/structures/creation-date.d.ts.map +0 -1
- package/dist/structures/creation-date.js +0 -1
- package/dist/structures/date.d.ts +0 -9
- package/dist/structures/date.d.ts.map +0 -1
- package/dist/structures/date.js +0 -1
- package/dist/structures/event-detail-structure.d.ts +0 -25
- package/dist/structures/event-detail-structure.d.ts.map +0 -1
- package/dist/structures/event-detail-structure.js +0 -1
- package/dist/structures/family.d.ts +0 -34
- package/dist/structures/family.d.ts.map +0 -1
- package/dist/structures/family.js +0 -1
- package/dist/structures/gedcom.d.ts +0 -59
- package/dist/structures/gedcom.d.ts.map +0 -1
- package/dist/structures/gedcom.js +0 -1
- package/dist/structures/index.d.ts.map +0 -1
- package/dist/structures/individual-event-detail-structure.d.ts +0 -9
- package/dist/structures/individual-event-detail-structure.d.ts.map +0 -1
- package/dist/structures/individual-event-detail-structure.js +0 -1
- package/dist/structures/individual-event-structure.d.ts +0 -83
- package/dist/structures/individual-event-structure.d.ts.map +0 -1
- package/dist/structures/individual-event-structure.js +0 -1
- package/dist/structures/individual.d.ts +0 -40
- package/dist/structures/individual.d.ts.map +0 -1
- package/dist/structures/individual.js +0 -1
- package/dist/structures/lds-ordinance-detail.d.ts +0 -17
- package/dist/structures/lds-ordinance-detail.d.ts.map +0 -1
- package/dist/structures/lds-ordinance-detail.js +0 -1
- package/dist/structures/lds-spouse-sealing.d.ts +0 -7
- package/dist/structures/lds-spouse-sealing.d.ts.map +0 -1
- package/dist/structures/lds-spouse-sealing.js +0 -1
- package/dist/structures/marriage-date.d.ts +0 -11
- package/dist/structures/marriage-date.d.ts.map +0 -1
- package/dist/structures/marriage-date.js +0 -1
- package/dist/structures/multimedia-link.d.ts +0 -16
- package/dist/structures/multimedia-link.d.ts.map +0 -1
- package/dist/structures/multimedia-link.js +0 -1
- package/dist/structures/non-event.d.ts +0 -12
- package/dist/structures/non-event.d.ts.map +0 -1
- package/dist/structures/non-event.js +0 -1
- package/dist/structures/note.d.ts +0 -16
- package/dist/structures/note.d.ts.map +0 -1
- package/dist/structures/note.js +0 -1
- package/dist/structures/personal-name-pieces.d.ts +0 -11
- package/dist/structures/personal-name-pieces.d.ts.map +0 -1
- package/dist/structures/personal-name-pieces.js +0 -1
- package/dist/structures/personal-name.d.ts +0 -16
- package/dist/structures/personal-name.d.ts.map +0 -1
- package/dist/structures/personal-name.js +0 -1
- package/dist/structures/place.d.ts +0 -20
- package/dist/structures/place.d.ts.map +0 -1
- package/dist/structures/place.js +0 -1
- package/dist/structures/repository.d.ts +0 -6
- package/dist/structures/repository.d.ts.map +0 -1
- package/dist/structures/repository.js +0 -1
- package/dist/structures/source-citation.d.ts +0 -27
- package/dist/structures/source-citation.d.ts.map +0 -1
- package/dist/structures/source-citation.js +0 -1
- package/dist/structures/source-repository-citation.d.ts +0 -13
- package/dist/structures/source-repository-citation.d.ts.map +0 -1
- package/dist/structures/source-repository-citation.js +0 -1
- package/dist/structures/source.d.ts +0 -28
- package/dist/structures/source.d.ts.map +0 -1
- package/dist/structures/source.js +0 -1
- package/dist/types/ancestry-media.d.ts +0 -65
- package/dist/types/ancestry-media.d.ts.map +0 -1
- package/dist/types/ancestry-media.js +0 -1
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/settings.d.ts +0 -12
- package/dist/types/settings.d.ts.map +0 -1
- package/dist/types/settings.js +0 -1
- package/dist/types/types.d.ts +0 -225
- package/dist/types/types.d.ts.map +0 -1
- package/dist/types/types.js +0 -26
- package/dist/utils/cache.d.ts +0 -22
- package/dist/utils/cache.d.ts.map +0 -1
- package/dist/utils/cache.js +0 -57
- package/dist/utils/common-creator.d.ts +0 -13
- package/dist/utils/common-creator.d.ts.map +0 -1
- package/dist/utils/common-creator.js +0 -72
- package/dist/utils/date-formatter.d.ts +0 -35
- package/dist/utils/date-formatter.d.ts.map +0 -1
- package/dist/utils/date-formatter.js +0 -207
- package/dist/utils/get-all-prop.d.ts +0 -4
- package/dist/utils/get-all-prop.d.ts.map +0 -1
- package/dist/utils/get-all-prop.js +0 -5
- package/dist/utils/get-family-with.d.ts +0 -5
- package/dist/utils/get-family-with.d.ts.map +0 -1
- package/dist/utils/get-family-with.js +0 -11
- package/dist/utils/get-places.d.ts +0 -21
- package/dist/utils/get-places.d.ts.map +0 -1
- package/dist/utils/get-places.js +0 -77
- package/dist/utils/get-product-details.d.ts +0 -4
- package/dist/utils/get-product-details.d.ts.map +0 -1
- package/dist/utils/get-product-details.js +0 -6
- package/dist/utils/get-raw-size.d.ts +0 -2
- package/dist/utils/get-raw-size.d.ts.map +0 -1
- package/dist/utils/get-raw-size.js +0 -3
- package/dist/utils/index.d.ts.map +0 -1
- package/dist/utils/logger.d.ts +0 -3
- package/dist/utils/logger.d.ts.map +0 -1
- package/dist/utils/logger.js +0 -11
- package/dist/utils/name-formatter.d.ts +0 -10
- package/dist/utils/name-formatter.d.ts.map +0 -1
- package/dist/utils/name-formatter.js +0 -45
- package/dist/utils/nested-group.d.ts +0 -4
- package/dist/utils/nested-group.d.ts.map +0 -1
- package/dist/utils/nested-group.js +0 -34
- package/dist/utils/ordinalize.d.ts +0 -3
- package/dist/utils/ordinalize.d.ts.map +0 -1
- package/dist/utils/ordinalize.js +0 -104
- package/dist/utils/parser.d.ts +0 -17
- package/dist/utils/parser.d.ts.map +0 -1
- package/dist/utils/parser.js +0 -321
- package/dist/utils/place-parser.d.ts +0 -16
- package/dist/utils/place-parser.d.ts.map +0 -1
- package/dist/utils/place-parser.js +0 -46
- package/dist/utils/place-translator.d.ts +0 -6
- package/dist/utils/place-translator.d.ts.map +0 -1
- package/dist/utils/place-translator.js +0 -8
- package/dist/utils/place-types.d.ts +0 -27
- package/dist/utils/place-types.d.ts.map +0 -1
- package/dist/utils/place-types.js +0 -14
- package/dist/utils/range.d.ts +0 -19
- package/dist/utils/range.d.ts.map +0 -1
- package/dist/utils/range.js +0 -265
package/dist/classes/date.js
DELETED
|
@@ -1,178 +0,0 @@
|
|
|
1
|
-
import { format, isValid, parse } from "date-fns";
|
|
2
|
-
import { getDateLocale } from "../factories/index.js";
|
|
3
|
-
import { ACCEPTED_DATE_FORMATS } from "../utils/date-formatter.js";
|
|
4
|
-
import { inRange } from "../utils/range.js";
|
|
5
|
-
import { Common, createCommon, createProxy } from "./common.js";
|
|
6
|
-
const LONG_NOTES = {
|
|
7
|
-
"Abt.": "About",
|
|
8
|
-
"Bef.": "Before",
|
|
9
|
-
"Aft.": "After",
|
|
10
|
-
};
|
|
11
|
-
const NOTE_MARKER = "####";
|
|
12
|
-
/**
|
|
13
|
-
* Format a date based on available components (DAY, MONTH, YEAR, NOTE)
|
|
14
|
-
*/
|
|
15
|
-
const formatDateWithComponents = (date, hasDay, hasMonth, hasYear, noteValue, baseFormat = "dd MMM yyyy", locale) => {
|
|
16
|
-
const hasNote = baseFormat.includes("NOTE");
|
|
17
|
-
let validDateFormat = baseFormat.replace("NOTE", NOTE_MARKER);
|
|
18
|
-
if (!hasDay) {
|
|
19
|
-
validDateFormat = validDateFormat.replace(/d+/g, "");
|
|
20
|
-
}
|
|
21
|
-
if (!hasMonth) {
|
|
22
|
-
validDateFormat = validDateFormat.replace(/[.\-\s/]*M+/g, "");
|
|
23
|
-
}
|
|
24
|
-
if (!hasYear) {
|
|
25
|
-
validDateFormat = validDateFormat.replace(/y+[.\-\s/]*/g, "");
|
|
26
|
-
}
|
|
27
|
-
validDateFormat = validDateFormat
|
|
28
|
-
.replace(/([.\-\s/])\1+/g, "$1")
|
|
29
|
-
.replace(/^[.\-\s/]+|[.\-\s/]+$/g, "");
|
|
30
|
-
const formattedDate = format(date, validDateFormat, {
|
|
31
|
-
...(locale !== null
|
|
32
|
-
? { locale: locale ? locale : getDateLocale() }
|
|
33
|
-
: {}),
|
|
34
|
-
});
|
|
35
|
-
// Add NOTE prefix if it exists
|
|
36
|
-
return noteValue && hasNote
|
|
37
|
-
? formattedDate.replace(NOTE_MARKER, noteValue).trim()
|
|
38
|
-
: formattedDate.replace(NOTE_MARKER, "").trim();
|
|
39
|
-
};
|
|
40
|
-
export class CommonDate extends Common {
|
|
41
|
-
constructor(gedcom, id, main, parent) {
|
|
42
|
-
super(gedcom, id, main, parent);
|
|
43
|
-
delete this.id;
|
|
44
|
-
}
|
|
45
|
-
set value(value) {
|
|
46
|
-
if (value) {
|
|
47
|
-
const noteRegExp = /^(?<note>[a-zA-Z]+\.)/;
|
|
48
|
-
const noteMatch = value.match(noteRegExp)?.groups;
|
|
49
|
-
let validValue = value;
|
|
50
|
-
if (noteMatch?.note) {
|
|
51
|
-
this.NOTE =
|
|
52
|
-
this.NOTE ||
|
|
53
|
-
createCommon(this._gedcom, undefined, this.main);
|
|
54
|
-
this.NOTE.value = noteMatch?.note;
|
|
55
|
-
validValue = value.replace(noteRegExp, "");
|
|
56
|
-
}
|
|
57
|
-
const acceptedDate = this.isValidDateFormat(validValue);
|
|
58
|
-
if (acceptedDate) {
|
|
59
|
-
this.DAY =
|
|
60
|
-
this.DAY ||
|
|
61
|
-
createCommon(this._gedcom, undefined, this.main);
|
|
62
|
-
this.DAY.value = format(acceptedDate, "dd");
|
|
63
|
-
this.MONTH =
|
|
64
|
-
this.MONTH ||
|
|
65
|
-
createCommon(this._gedcom, undefined, this.main);
|
|
66
|
-
this.MONTH.value = format(acceptedDate, "MMM");
|
|
67
|
-
this.YEAR =
|
|
68
|
-
this.YEAR ||
|
|
69
|
-
createCommon(this._gedcom, undefined, this.main);
|
|
70
|
-
this.YEAR.value = format(acceptedDate, "yyyy");
|
|
71
|
-
this._date = acceptedDate;
|
|
72
|
-
this._value = value;
|
|
73
|
-
}
|
|
74
|
-
else {
|
|
75
|
-
let fixedValue = validValue;
|
|
76
|
-
if (/\d{4} [A-Za-z]+\s*$/.test(validValue)) {
|
|
77
|
-
fixedValue = `${validValue} 1`;
|
|
78
|
-
}
|
|
79
|
-
else if (/^\s*[A-Za-z]+ \d{4}/.test(validValue)) {
|
|
80
|
-
fixedValue = `1 ${validValue}`;
|
|
81
|
-
}
|
|
82
|
-
this._date = new Date(fixedValue);
|
|
83
|
-
this._value = value;
|
|
84
|
-
if (this._date && isValid(this._date)) {
|
|
85
|
-
const yearMonthDay = /[\dA-Za-z]+ [\dA-Za-z]+ [\dA-Za-z]+/.test(validValue);
|
|
86
|
-
const yearMonth = /[\dA-Za-z]+ [\dA-Za-z]+/.test(validValue);
|
|
87
|
-
const year = /[\dA-Za-z]+/.test(validValue);
|
|
88
|
-
if (yearMonthDay) {
|
|
89
|
-
this.DAY =
|
|
90
|
-
this.DAY ||
|
|
91
|
-
createCommon(this._gedcom, undefined, this.main);
|
|
92
|
-
this.DAY.value = format(this._date, "dd");
|
|
93
|
-
}
|
|
94
|
-
if (yearMonth || yearMonthDay) {
|
|
95
|
-
this.MONTH =
|
|
96
|
-
this.MONTH ||
|
|
97
|
-
createCommon(this._gedcom, undefined, this.main);
|
|
98
|
-
this.MONTH.value = format(this._date, "MMM");
|
|
99
|
-
}
|
|
100
|
-
if (year || yearMonth || yearMonthDay) {
|
|
101
|
-
this.YEAR =
|
|
102
|
-
this.YEAR ||
|
|
103
|
-
createCommon(this._gedcom, undefined, this.main);
|
|
104
|
-
this.YEAR.value = format(this._date, "yyyy");
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
get value() {
|
|
111
|
-
const hasDay = !!this.DAY?.value;
|
|
112
|
-
const hasMonth = !!this.MONTH?.value;
|
|
113
|
-
const hasYear = !!this.YEAR?.value;
|
|
114
|
-
if (!this._date ||
|
|
115
|
-
!isValid(this._date) ||
|
|
116
|
-
(!hasDay && !hasMonth && !hasYear)) {
|
|
117
|
-
return this._value;
|
|
118
|
-
}
|
|
119
|
-
return formatDateWithComponents(this._date, hasDay, hasMonth, hasYear, this.NOTE?.value);
|
|
120
|
-
}
|
|
121
|
-
get rawValue() {
|
|
122
|
-
return this._date;
|
|
123
|
-
}
|
|
124
|
-
assign(name, value, unique = false) {
|
|
125
|
-
if (!["DAY", "MONTH", "YEAR"].includes(name)) {
|
|
126
|
-
return super.assign(name, value, unique);
|
|
127
|
-
}
|
|
128
|
-
else {
|
|
129
|
-
this.set(name, value);
|
|
130
|
-
}
|
|
131
|
-
return this.get(name);
|
|
132
|
-
}
|
|
133
|
-
isValidDateFormat(value) {
|
|
134
|
-
let validDate;
|
|
135
|
-
ACCEPTED_DATE_FORMATS.find((acceptedFormat) => {
|
|
136
|
-
const date = parse(value, acceptedFormat, new Date());
|
|
137
|
-
if (isValid(date)) {
|
|
138
|
-
validDate = date;
|
|
139
|
-
return true;
|
|
140
|
-
}
|
|
141
|
-
return false;
|
|
142
|
-
});
|
|
143
|
-
return validDate;
|
|
144
|
-
}
|
|
145
|
-
toNote(short = true) {
|
|
146
|
-
const note = this.NOTE?.value?.trim();
|
|
147
|
-
if (!short) {
|
|
148
|
-
return LONG_NOTES[note];
|
|
149
|
-
}
|
|
150
|
-
return note;
|
|
151
|
-
}
|
|
152
|
-
toValue(dateFormat = "dd MMM yyyy", locale) {
|
|
153
|
-
const hasDay = !!this.DAY?.value;
|
|
154
|
-
const hasMonth = !!this.MONTH?.value;
|
|
155
|
-
const hasYear = !!this.YEAR?.value;
|
|
156
|
-
if (!this._date ||
|
|
157
|
-
!isValid(this._date) ||
|
|
158
|
-
(!hasDay && !hasMonth && !hasYear)) {
|
|
159
|
-
return this._value;
|
|
160
|
-
}
|
|
161
|
-
return formatDateWithComponents(this._date, hasDay, hasMonth, hasYear, this.NOTE?.value, dateFormat, locale);
|
|
162
|
-
}
|
|
163
|
-
exportValue() {
|
|
164
|
-
return this.toValue("NOTE dd MMM yyyy", null);
|
|
165
|
-
}
|
|
166
|
-
inRange(range, trueIfNoYear = false) {
|
|
167
|
-
return inRange(this.YEAR?.value, range, trueIfNoYear);
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
export const createCommonDate = (gedcom, id, main, parent) => {
|
|
171
|
-
return createProxy(new CommonDate(gedcom, id, main, parent));
|
|
172
|
-
};
|
|
173
|
-
export const isCommonDate = (value) => {
|
|
174
|
-
return (!!value &&
|
|
175
|
-
value !== null &&
|
|
176
|
-
typeof value === "object" &&
|
|
177
|
-
"_date" in value);
|
|
178
|
-
};
|
package/dist/classes/fam.d.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import type IFam from "../interfaces/fam";
|
|
2
|
-
import type IFamilyStructure from "../structures/family";
|
|
3
|
-
import type { FamKey } from "../types/types";
|
|
4
|
-
import { Common } from "./common";
|
|
5
|
-
import type { ProxyOriginal } from "./common";
|
|
6
|
-
import { Families } from "./fams";
|
|
7
|
-
import type { GedComType } from "./gedcom";
|
|
8
|
-
import { Individuals } from "./indis";
|
|
9
|
-
export declare class Fam extends Common<string, FamKey> implements IFam {
|
|
10
|
-
private getFamilyMembers;
|
|
11
|
-
getChildren(): Individuals;
|
|
12
|
-
getHusband(): Individuals;
|
|
13
|
-
getWife(): Individuals;
|
|
14
|
-
getParents(): Individuals;
|
|
15
|
-
toList(): Families;
|
|
16
|
-
}
|
|
17
|
-
export type FamType = Fam & IFamilyStructure;
|
|
18
|
-
export declare const createFam: (gedcom: GedComType, id: FamKey, main?: Common, parent?: Common) => ProxyOriginal<FamType>;
|
|
19
|
-
//# sourceMappingURL=fam.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fam.d.ts","sourceRoot":"","sources":["../../src/classes/fam.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,mBAAmB,CAAC;AAC1C,OAAO,KAAK,gBAAgB,MAAM,sBAAsB,CAAC;AACzD,OAAO,KAAK,EAAE,MAAM,EAAW,MAAM,gBAAgB,CAAC;AAEtD,OAAO,EAAE,MAAM,EAAe,MAAM,UAAU,CAAC;AAC/C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAClC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAEtC,qBAAa,GAAI,SAAQ,MAAM,CAAC,MAAM,EAAE,MAAM,CAAE,YAAW,IAAI;IAC9D,OAAO,CAAC,gBAAgB;IAexB,WAAW;IAIX,UAAU;IAIV,OAAO;IAIP,UAAU,IAAI,WAAW;IAIzB,MAAM;CAMN;AAED,MAAM,MAAM,OAAO,GAAG,GAAG,GAAG,gBAAgB,CAAC;AAC7C,eAAO,MAAM,SAAS,GACrB,QAAQ,UAAU,EAClB,IAAI,MAAM,EACV,OAAO,MAAM,EACb,SAAS,MAAM,KACb,aAAa,CAAC,OAAO,CAIvB,CAAC"}
|
package/dist/classes/fam.js
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { Common, createProxy } from "./common.js";
|
|
2
|
-
import { Families } from "./fams.js";
|
|
3
|
-
import { Individuals } from "./indis.js";
|
|
4
|
-
export class Fam extends Common {
|
|
5
|
-
getFamilyMembers(type) {
|
|
6
|
-
const familyMembers = new Individuals();
|
|
7
|
-
this.get(type)
|
|
8
|
-
?.toList()
|
|
9
|
-
.forEach((item) => {
|
|
10
|
-
const indiId = item.value;
|
|
11
|
-
const indi = this._gedcom?.indi(indiId);
|
|
12
|
-
if (indi) {
|
|
13
|
-
familyMembers.item(indiId, indi);
|
|
14
|
-
}
|
|
15
|
-
});
|
|
16
|
-
return familyMembers;
|
|
17
|
-
}
|
|
18
|
-
getChildren() {
|
|
19
|
-
return this.getFamilyMembers("CHIL");
|
|
20
|
-
}
|
|
21
|
-
getHusband() {
|
|
22
|
-
return this.getFamilyMembers("HUSB");
|
|
23
|
-
}
|
|
24
|
-
getWife() {
|
|
25
|
-
return this.getFamilyMembers("WIFE");
|
|
26
|
-
}
|
|
27
|
-
getParents() {
|
|
28
|
-
return this.getHusband().copy().merge(this.getWife());
|
|
29
|
-
}
|
|
30
|
-
toList() {
|
|
31
|
-
return new Families().concat(
|
|
32
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
33
|
-
this.id ? { [this.id]: this } : { ...[this] });
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
export const createFam = (gedcom, id, main, parent) => {
|
|
37
|
-
return createProxy(new Fam(gedcom, id, main, parent));
|
|
38
|
-
};
|
package/dist/classes/fams.d.ts
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { IFamilies } from "../interfaces/fams";
|
|
2
|
-
import type { FamKey, Filter, Order, FilterIterator, OrderIterator } from "../types/types";
|
|
3
|
-
import type { FamType } from "./fam";
|
|
4
|
-
import { Individuals } from "./indis";
|
|
5
|
-
import { List } from "./list";
|
|
6
|
-
export declare class Families extends List<FamKey, FamType> implements IFamilies {
|
|
7
|
-
copy(): Families;
|
|
8
|
-
except(item: FamType): Families;
|
|
9
|
-
filter(filters: Filter | FilterIterator<FamType, FamKey>): Families;
|
|
10
|
-
find(filters: Filter | FilterIterator<FamType, FamKey>): FamType | undefined;
|
|
11
|
-
orderBy(orders: Order | OrderIterator<FamType, FamKey>): Families;
|
|
12
|
-
getParents(): Individuals;
|
|
13
|
-
getChildren(): Individuals;
|
|
14
|
-
toList(): Families;
|
|
15
|
-
}
|
|
16
|
-
//# sourceMappingURL=fams.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fams.d.ts","sourceRoot":"","sources":["../../src/classes/fams.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,SAAS,EAAC,MAAM,oBAAoB,CAAC;AAClD,OAAO,KAAK,EAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,cAAc,EAAE,aAAa,EAAC,MAAM,gBAAgB,CAAC;AAGzF,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,OAAO,CAAC;AACnC,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AACtC,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAE9B,qBAAa,QAAS,SAAQ,IAAI,CAAC,MAAM,EAAE,OAAO,CAAE,YAAW,SAAS;IACvE,IAAI,IAAI,QAAQ;IAIhB,MAAM,CAAC,IAAI,EAAE,OAAO,GAAG,QAAQ;IAI/B,MAAM,CAAC,OAAO,EAAE,MAAM,GAAG,cAAc,CAAC,OAAO,EAAE,MAAM,CAAC,GAAG,QAAQ;IAInE,IAAI,CACH,OAAO,EAAE,MAAM,GAAG,cAAc,CAAC,OAAO,EAAE,MAAM,CAAC,GAC/C,OAAO,GAAG,SAAS;IAItB,OAAO,CAAC,MAAM,EAAE,KAAK,GAAG,aAAa,CAAC,OAAO,EAAE,MAAM,CAAC,GAAG,QAAQ;IAIjE,UAAU,IAAI,WAAW;IAYzB,WAAW,IAAI,WAAW;IAY1B,MAAM;CAGN"}
|
package/dist/classes/fams.js
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
import { Fam } from "./fam.js";
|
|
2
|
-
import { Individuals } from "./indis.js";
|
|
3
|
-
import { List } from "./list.js";
|
|
4
|
-
export class Families extends List {
|
|
5
|
-
copy() {
|
|
6
|
-
return super.copy(Families);
|
|
7
|
-
}
|
|
8
|
-
except(item) {
|
|
9
|
-
return super.except(item, Families);
|
|
10
|
-
}
|
|
11
|
-
filter(filters) {
|
|
12
|
-
return super.filter(filters, Families);
|
|
13
|
-
}
|
|
14
|
-
find(filters) {
|
|
15
|
-
return super.find(filters, Families);
|
|
16
|
-
}
|
|
17
|
-
orderBy(orders) {
|
|
18
|
-
return super.orderBy(orders, Families);
|
|
19
|
-
}
|
|
20
|
-
getParents() {
|
|
21
|
-
const persons = new Individuals();
|
|
22
|
-
this.values().forEach((fam) => {
|
|
23
|
-
if (fam && fam instanceof Fam) {
|
|
24
|
-
persons.merge(fam.getParents());
|
|
25
|
-
}
|
|
26
|
-
});
|
|
27
|
-
return persons;
|
|
28
|
-
}
|
|
29
|
-
getChildren() {
|
|
30
|
-
const persons = new Individuals();
|
|
31
|
-
this.values().forEach((fam) => {
|
|
32
|
-
if (fam && fam instanceof Fam) {
|
|
33
|
-
persons.merge(fam.getChildren());
|
|
34
|
-
}
|
|
35
|
-
});
|
|
36
|
-
return persons;
|
|
37
|
-
}
|
|
38
|
-
toList() {
|
|
39
|
-
return new Families().concat(this.getItems());
|
|
40
|
-
}
|
|
41
|
-
}
|
package/dist/classes/gedcom.d.ts
DELETED
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
import type { ConvertOptions } from "../interfaces/common";
|
|
2
|
-
import type IGedcom from "../interfaces/gedcom";
|
|
3
|
-
import type IGedComStructure from "../structures/gedcom";
|
|
4
|
-
import type { IdType, IndiKey, FamKey, ObjeKey, SourKey, RepoKey, SubmKey, MultiTag } from "../types/types";
|
|
5
|
-
import { Common } from "./common";
|
|
6
|
-
import type { FamType } from "./fam";
|
|
7
|
-
import type { Families } from "./fams";
|
|
8
|
-
import type { IndiType } from "./indi";
|
|
9
|
-
import type { Individuals } from "./indis";
|
|
10
|
-
import { List } from "./list";
|
|
11
|
-
import type { ObjeType } from "./obje";
|
|
12
|
-
import type { Objects } from "./objes";
|
|
13
|
-
import type { RepoType } from "./repo";
|
|
14
|
-
import type { Repositories } from "./repos";
|
|
15
|
-
import type { SourType } from "./sour";
|
|
16
|
-
import type { Sources } from "./sours";
|
|
17
|
-
import type { SubmType } from "./subm";
|
|
18
|
-
import type { Submitters } from "./subms";
|
|
19
|
-
export declare class GedCom extends Common implements IGedcom {
|
|
20
|
-
tagMembers: Record<string, {
|
|
21
|
-
tag: Common;
|
|
22
|
-
indis: Individuals;
|
|
23
|
-
}>;
|
|
24
|
-
reflist: Record<string, Common>;
|
|
25
|
-
refcount: number;
|
|
26
|
-
constructor();
|
|
27
|
-
private getMain;
|
|
28
|
-
getList<T extends List = List>(type: MultiTag): T | undefined;
|
|
29
|
-
indis(): Individuals;
|
|
30
|
-
cloneIndis(target?: IndiKey | IndiType, source?: IndiKey | IndiType, avoidKeys?: MultiTag[], removeFromOriginalList?: boolean): this;
|
|
31
|
-
mergeIndis(target?: IndiKey | IndiType, source?: IndiKey | IndiType, removeFromOriginalList?: boolean): this;
|
|
32
|
-
fams(): Families;
|
|
33
|
-
objes(): Objects;
|
|
34
|
-
sours(): Sources;
|
|
35
|
-
repos(): Repositories;
|
|
36
|
-
subms(): Submitters;
|
|
37
|
-
tags(): List<IdType, Common<string, IdType>>;
|
|
38
|
-
customTags(): List<IdType, Common<string, IdType>>;
|
|
39
|
-
indi(index: number | IndiKey): IndiType;
|
|
40
|
-
fam(index: number | FamKey): FamType;
|
|
41
|
-
obje(index: number | ObjeKey): ObjeType;
|
|
42
|
-
sour(index: number | SourKey): SourType;
|
|
43
|
-
repo(index: number | RepoKey): RepoType;
|
|
44
|
-
subm(index: number | SubmKey): SubmType;
|
|
45
|
-
tag(index: number | SubmKey): Common<string, IdType>;
|
|
46
|
-
fromList(id?: string): Common<string, IdType>;
|
|
47
|
-
tagByName(name?: string): Common<string, IdType>;
|
|
48
|
-
customTag(index: number | SubmKey): Common<string, IdType>;
|
|
49
|
-
private getIndiRelatedLists;
|
|
50
|
-
private getDownloadHeader;
|
|
51
|
-
toFiltered(indis: IndiKey[]): this | GedComType;
|
|
52
|
-
toJson(tag?: MultiTag | undefined, options?: (ConvertOptions & {
|
|
53
|
-
indis?: IndiKey[];
|
|
54
|
-
}) | undefined): string;
|
|
55
|
-
toGedcom(tag?: MultiTag | undefined, level?: number, options?: (ConvertOptions & {
|
|
56
|
-
indis?: IndiKey[];
|
|
57
|
-
}) | undefined): string;
|
|
58
|
-
hasTag(tag?: string | Common): boolean;
|
|
59
|
-
hasUnknownAncestor(): boolean;
|
|
60
|
-
hasIgnoredMember(): boolean;
|
|
61
|
-
hasUnattachedMember(): boolean;
|
|
62
|
-
hasUnknownGivenname(): boolean;
|
|
63
|
-
hasUnknownSurname(): boolean;
|
|
64
|
-
hasNonRelevant(): boolean;
|
|
65
|
-
/**
|
|
66
|
-
* Get all places from the GEDCOM with occurrence counts
|
|
67
|
-
* @returns Record mapping place names to their occurrence count
|
|
68
|
-
*/
|
|
69
|
-
getAllPlaces(): Record<string, number>;
|
|
70
|
-
/**
|
|
71
|
-
* Get all places from the GEDCOM with associated individual IDs
|
|
72
|
-
* @param usedIndis Optional array of individual IDs to filter by
|
|
73
|
-
* @returns Record mapping place names to arrays of individual IDs
|
|
74
|
-
*/
|
|
75
|
-
getAllPlacesWithIndis(usedIndis?: IndiKey[]): Record<string, (`@I${number}@` | `@P${number}@` | `@XI${number}@` | `@XXI${number}@`)[]>;
|
|
76
|
-
/**
|
|
77
|
-
* Generate statistics about the GEDCOM file
|
|
78
|
-
* @param individuals Optional list of individuals to calculate statistics for. If not provided, all individuals from the GEDCOM will be used.
|
|
79
|
-
* @returns Object containing various statistics about the GEDCOM data
|
|
80
|
-
*/
|
|
81
|
-
stats(individuals?: Individuals): {
|
|
82
|
-
totalIndividuals: number;
|
|
83
|
-
totalFamilies: number;
|
|
84
|
-
byGender: {
|
|
85
|
-
males: number;
|
|
86
|
-
females: number;
|
|
87
|
-
unknown: number;
|
|
88
|
-
};
|
|
89
|
-
dateRange: {
|
|
90
|
-
earliest: number;
|
|
91
|
-
latest: number;
|
|
92
|
-
};
|
|
93
|
-
averageLifespan: number;
|
|
94
|
-
topSurnames: {
|
|
95
|
-
surname: string;
|
|
96
|
-
count: number;
|
|
97
|
-
}[];
|
|
98
|
-
topBirthPlaces: {
|
|
99
|
-
place: string;
|
|
100
|
-
count: number;
|
|
101
|
-
}[];
|
|
102
|
-
firstPersonEvent: any;
|
|
103
|
-
lastPersonEvent: any;
|
|
104
|
-
};
|
|
105
|
-
}
|
|
106
|
-
export type GedComType = GedCom & IGedComStructure;
|
|
107
|
-
export declare const createGedCom: () => GedComType;
|
|
108
|
-
export declare const isGedcomString: (gedcomString?: string) => boolean;
|
|
109
|
-
/**
|
|
110
|
-
* Validates if a string is a valid GEDCOM file content
|
|
111
|
-
* @param content - The file content to validate
|
|
112
|
-
* @returns An object with `valid` boolean and optional `error` message
|
|
113
|
-
*/
|
|
114
|
-
export declare const validateGedcomContent: (content?: string) => {
|
|
115
|
-
valid: boolean;
|
|
116
|
-
error?: string;
|
|
117
|
-
};
|
|
118
|
-
/**
|
|
119
|
-
* Merge two GEDCOM objects into a single result using a configurable matching strategy
|
|
120
|
-
* @param targetGedcom - The base GEDCOM (kept as the primary source)
|
|
121
|
-
* @param sourceGedcom - The GEDCOM to be merged into the target
|
|
122
|
-
* @param strategy - Matching strategy: "id" (default) to match by individual ID, or any MultiTag (e.g., "NAME", "BIRT.DATE") to match by that field's value
|
|
123
|
-
* @returns The merged GedComType with all individuals and families combined
|
|
124
|
-
*
|
|
125
|
-
* @example
|
|
126
|
-
* // Merge by ID (individuals with same ID are considered the same person)
|
|
127
|
-
* const merged = await mergeGedcoms(target, source, "id");
|
|
128
|
-
*
|
|
129
|
-
* @example
|
|
130
|
-
* // Merge by NAME (individuals with same name are considered the same person)
|
|
131
|
-
* const merged = await mergeGedcoms(target, source, "NAME");
|
|
132
|
-
*
|
|
133
|
-
* @remarks
|
|
134
|
-
* - Source individuals are always assigned new unique IDs to avoid conflicts
|
|
135
|
-
* - When individuals match by strategy, they are merged (data and relationships combined)
|
|
136
|
-
* - All family relationships (FAMS/FAMC) are preserved with updated ID references
|
|
137
|
-
*/
|
|
138
|
-
export declare const mergeGedcoms: (targetGedcom: GedComType, sourceGedcom: GedComType, strategy?: MultiTag | "id") => GedComType;
|
|
139
|
-
//# sourceMappingURL=gedcom.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"gedcom.d.ts","sourceRoot":"","sources":["../../src/classes/gedcom.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,KAAK,OAAO,MAAM,sBAAsB,CAAC;AAEhD,OAAO,KAAK,gBAAgB,MAAM,sBAAsB,CAAC;AACzD,OAAO,KAAK,EAEX,MAAM,EACN,OAAO,EACP,MAAM,EACN,OAAO,EACP,OAAO,EACP,OAAO,EACP,OAAO,EACP,QAAQ,EACR,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EAAE,MAAM,EAAgB,MAAM,UAAU,CAAC;AAChD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AACrC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAEvC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAC;AACvC,OAAO,KAAK,EAAE,WAAW,EAAE,MAA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