@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
|
@@ -1,207 +0,0 @@
|
|
|
1
|
-
import { createCommonDate } from "../classes/date.js";
|
|
2
|
-
import { i18n } from "../factories/i18n-factory.js";
|
|
3
|
-
import { getAllProp } from "./get-all-prop.js";
|
|
4
|
-
export const ACCEPTED_DATE_FORMATS = [
|
|
5
|
-
"yyyy.MM.dd.",
|
|
6
|
-
"yyyy-MM-dd",
|
|
7
|
-
"MM/dd/yyyy",
|
|
8
|
-
];
|
|
9
|
-
export const ACCEPTED_DATE_FORMATS_REGEX = new RegExp(`(${ACCEPTED_DATE_FORMATS.map((acceptedFormat) => acceptedFormat.replace(/[^.\-/]/g, "\\d")).join("|")})`, "gi");
|
|
10
|
-
export const commonDateFormatter = (date, format = "yyyy", prefix = "") => {
|
|
11
|
-
const formattedDate = date?.toValue(format);
|
|
12
|
-
if (!formattedDate) {
|
|
13
|
-
return undefined;
|
|
14
|
-
}
|
|
15
|
-
return `${prefix}${formattedDate}`.trim();
|
|
16
|
-
};
|
|
17
|
-
export const noteDateFormatter = (date, format = "yyyy", prefix = "", shortNote = true, showNote = true) => {
|
|
18
|
-
const rawDate = commonDateFormatter(date, format, "");
|
|
19
|
-
if (!rawDate) {
|
|
20
|
-
return undefined;
|
|
21
|
-
}
|
|
22
|
-
const note = date?.toNote(shortNote) ?? "";
|
|
23
|
-
return `${prefix}${note && showNote
|
|
24
|
-
? i18n.t(`${note} {{date}}`, { date: rawDate })
|
|
25
|
-
: rawDate}`;
|
|
26
|
-
};
|
|
27
|
-
export const marriageDateFormatter = (fam, showDays = false, showPlaces = false, shortNote = true, showNote = true, showDisplayTextIfNoDate = true, showAllEvents = false, dateFormatPattern) => {
|
|
28
|
-
// Determine the format to use for full dates
|
|
29
|
-
const fullDateFormat = dateFormatPattern ?? i18n.t("dateFormat");
|
|
30
|
-
const marriageDates = [];
|
|
31
|
-
const marriagePlaces = [];
|
|
32
|
-
const marriages = (fam?.toValueList().values() ?? []).flatMap((fam) => {
|
|
33
|
-
const family = fam;
|
|
34
|
-
// Get all MARR events for this family
|
|
35
|
-
const marrEvents = (family?.MARR?.toList().values() ?? []).filter(Boolean);
|
|
36
|
-
if (marrEvents.length === 0) {
|
|
37
|
-
// Handle displayText for families without MARR events
|
|
38
|
-
const displayText = (family?.get("DISPLAYTEXT")?.toValue() ??
|
|
39
|
-
"");
|
|
40
|
-
if (showDisplayTextIfNoDate && displayText) {
|
|
41
|
-
const displayDate = displayText.match(ACCEPTED_DATE_FORMATS_REGEX)?.[0];
|
|
42
|
-
if (displayDate) {
|
|
43
|
-
marriagePlaces.push(displayText.replace(displayDate, ""));
|
|
44
|
-
const marriageDate = createCommonDate(fam?.getGedcom(), undefined, family);
|
|
45
|
-
marriageDate.value = displayDate;
|
|
46
|
-
marriageDates.push(marriageDate);
|
|
47
|
-
}
|
|
48
|
-
else {
|
|
49
|
-
marriagePlaces.push(displayText);
|
|
50
|
-
marriageDates.push(undefined);
|
|
51
|
-
return ["∞"];
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
return [];
|
|
55
|
-
}
|
|
56
|
-
// Process all MARR events
|
|
57
|
-
const eventsToProcess = showAllEvents
|
|
58
|
-
? marrEvents
|
|
59
|
-
: marrEvents.slice(0, 1);
|
|
60
|
-
return eventsToProcess.map((marrEvent) => {
|
|
61
|
-
const marriageEventDetail = marrEvent;
|
|
62
|
-
const marriageDate = marriageEventDetail?.DATE;
|
|
63
|
-
const marriagePlace = showPlaces
|
|
64
|
-
? marriageEventDetail?.PLAC?.value
|
|
65
|
-
: undefined;
|
|
66
|
-
marriagePlaces.push(marriagePlace);
|
|
67
|
-
marriageDates.push(marriageDate);
|
|
68
|
-
const formattedDate = noteDateFormatter(marriageDate, showDays ? fullDateFormat : "yyyy", "∞", shortNote, showNote);
|
|
69
|
-
return formattedDate ? formattedDate : undefined;
|
|
70
|
-
});
|
|
71
|
-
});
|
|
72
|
-
const marriageArray = marriages.length
|
|
73
|
-
? marriages.filter(Boolean)
|
|
74
|
-
: [];
|
|
75
|
-
const datesArray = marriageArray.filter(Boolean);
|
|
76
|
-
const placesArray = marriagePlaces.filter(Boolean);
|
|
77
|
-
const dates = datesArray.join(" ").trim();
|
|
78
|
-
return {
|
|
79
|
-
rawArray: marriageDates,
|
|
80
|
-
inArray: datesArray,
|
|
81
|
-
inOrder: dates,
|
|
82
|
-
places: placesArray,
|
|
83
|
-
marriage: marriageArray,
|
|
84
|
-
...(showPlaces
|
|
85
|
-
? {
|
|
86
|
-
marriages,
|
|
87
|
-
marriagePlaces,
|
|
88
|
-
}
|
|
89
|
-
: {}),
|
|
90
|
-
};
|
|
91
|
-
};
|
|
92
|
-
export const dateFormatter = (indi, showMarriages = false, showDays = false, showPlaces = false, shortNote = true, showNote = true, isOnStage, showAllEvents = false, dateFormatPattern) => {
|
|
93
|
-
// Determine the format to use for full dates
|
|
94
|
-
const fullDateFormat = dateFormatPattern ?? i18n.t("dateFormat");
|
|
95
|
-
// Get all birth events
|
|
96
|
-
const birthEvents = getAllProp(indi, "BIRT");
|
|
97
|
-
const firstBirthValue = birthEvents[0];
|
|
98
|
-
// Get all death events
|
|
99
|
-
const deathEvents = getAllProp(indi, "DEAT");
|
|
100
|
-
const firstDeathValue = deathEvents[0];
|
|
101
|
-
const birth = commonDateFormatter(firstBirthValue?.DATE, showDays ? fullDateFormat : "yyyy");
|
|
102
|
-
const birthPlace = showPlaces ? firstBirthValue?.PLAC?.value : undefined;
|
|
103
|
-
const death = commonDateFormatter(firstDeathValue?.DATE, showDays ? fullDateFormat : "yyyy");
|
|
104
|
-
const deathPlace = showPlaces ? firstDeathValue?.PLAC?.value : undefined;
|
|
105
|
-
const marriagePlaces = [];
|
|
106
|
-
const marriages = [];
|
|
107
|
-
if (showMarriages || isOnStage) {
|
|
108
|
-
(indi?.get("FAMS")?.toValueList().values() ?? []).forEach((fam) => {
|
|
109
|
-
const famRef = fam?.ref;
|
|
110
|
-
if (isOnStage && famRef) {
|
|
111
|
-
let partner;
|
|
112
|
-
if (famRef.HUSB && indi && famRef.HUSB.value === indi.id) {
|
|
113
|
-
partner = famRef.WIFE?.value;
|
|
114
|
-
}
|
|
115
|
-
else if (famRef.WIFE &&
|
|
116
|
-
indi &&
|
|
117
|
-
famRef.WIFE.value === indi.id) {
|
|
118
|
-
partner = famRef.HUSB?.value;
|
|
119
|
-
}
|
|
120
|
-
if (partner && isOnStage(partner)) {
|
|
121
|
-
return;
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
const marriageDates = marriageDateFormatter(famRef, showDays, showPlaces, shortNote, showNote, true, showAllEvents, dateFormatPattern);
|
|
125
|
-
marriages.push(...(marriageDates?.marriage ?? []));
|
|
126
|
-
marriagePlaces.push(...(marriageDates?.marriagePlaces ?? []));
|
|
127
|
-
});
|
|
128
|
-
}
|
|
129
|
-
// Process all birth events
|
|
130
|
-
const birthStrings = [];
|
|
131
|
-
const birthPlaces = [];
|
|
132
|
-
const eventsToProcess = showAllEvents
|
|
133
|
-
? birthEvents
|
|
134
|
-
: birthEvents.slice(0, 1);
|
|
135
|
-
eventsToProcess.forEach((birthEvent) => {
|
|
136
|
-
const birthDate = commonDateFormatter(birthEvent?.DATE, showDays ? fullDateFormat : "yyyy");
|
|
137
|
-
const birthEventNote = birthEvent?.DATE?.toNote(shortNote) ?? "";
|
|
138
|
-
const birthEventPlace = showPlaces
|
|
139
|
-
? birthEvent?.PLAC?.value
|
|
140
|
-
: undefined;
|
|
141
|
-
if (birthDate) {
|
|
142
|
-
birthStrings.push(`*${birthEventNote && showNote
|
|
143
|
-
? i18n.t(`${birthEventNote} {{date}}`, {
|
|
144
|
-
date: birthDate,
|
|
145
|
-
})
|
|
146
|
-
: birthDate}`);
|
|
147
|
-
}
|
|
148
|
-
birthPlaces.push(birthEventPlace);
|
|
149
|
-
});
|
|
150
|
-
// Process all death events
|
|
151
|
-
const deathStrings = [];
|
|
152
|
-
const deathPlaces = [];
|
|
153
|
-
const deathEventsToProcess = showAllEvents
|
|
154
|
-
? deathEvents
|
|
155
|
-
: deathEvents.slice(0, 1);
|
|
156
|
-
deathEventsToProcess.forEach((deathEvent) => {
|
|
157
|
-
const deathDate = commonDateFormatter(deathEvent?.DATE, showDays ? fullDateFormat : "yyyy");
|
|
158
|
-
const deathEventNote = deathEvent?.DATE?.toNote(shortNote) ?? "";
|
|
159
|
-
const deathEventPlace = showPlaces
|
|
160
|
-
? deathEvent?.PLAC?.value
|
|
161
|
-
: undefined;
|
|
162
|
-
if (deathDate) {
|
|
163
|
-
deathStrings.push(`†${deathEventNote && showNote
|
|
164
|
-
? i18n.t(`${deathEventNote} {{date}}`, {
|
|
165
|
-
date: deathDate,
|
|
166
|
-
})
|
|
167
|
-
: deathDate}`);
|
|
168
|
-
}
|
|
169
|
-
deathPlaces.push(deathEventPlace);
|
|
170
|
-
});
|
|
171
|
-
const birthString = birthStrings[0] ?? "";
|
|
172
|
-
const deathString = deathStrings[0] ?? "";
|
|
173
|
-
const marriageArray = marriages.length
|
|
174
|
-
? marriages.filter(Boolean)
|
|
175
|
-
: [];
|
|
176
|
-
const datesArray = !birth && !death
|
|
177
|
-
? marriageArray
|
|
178
|
-
: [...birthStrings, ...marriageArray, ...deathStrings];
|
|
179
|
-
const placesArray = !birth && !death
|
|
180
|
-
? marriagePlaces
|
|
181
|
-
: [...birthPlaces, ...marriagePlaces, ...deathPlaces];
|
|
182
|
-
const nonNullDatesArray = datesArray.filter(Boolean);
|
|
183
|
-
const dates = nonNullDatesArray.join(" ").trim();
|
|
184
|
-
return {
|
|
185
|
-
inArray: nonNullDatesArray,
|
|
186
|
-
inOrder: dates,
|
|
187
|
-
places: placesArray,
|
|
188
|
-
birth: birthString,
|
|
189
|
-
marriage: marriageArray,
|
|
190
|
-
death: deathString,
|
|
191
|
-
...(showPlaces
|
|
192
|
-
? {
|
|
193
|
-
birthPlace,
|
|
194
|
-
deathPlace,
|
|
195
|
-
...(showMarriages ? { marriages, marriagePlaces } : {}),
|
|
196
|
-
}
|
|
197
|
-
: {}),
|
|
198
|
-
...(showAllEvents
|
|
199
|
-
? {
|
|
200
|
-
births: birthStrings,
|
|
201
|
-
birthPlaces,
|
|
202
|
-
deaths: deathStrings,
|
|
203
|
-
deathPlaces,
|
|
204
|
-
}
|
|
205
|
-
: {}),
|
|
206
|
-
};
|
|
207
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-all-prop.d.ts","sourceRoot":"","sources":["../../src/utils/get-all-prop.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAChD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE/C,eAAO,MAAM,UAAU,GAAI,CAAC,EAAE,OAAO,QAAQ,EAAE,OAAO,QAAQ,KAGrD,CAAC,EACT,CAAC"}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { FamType } from "../classes/fam";
|
|
2
|
-
import type { IndiType } from "../classes/indi";
|
|
3
|
-
import type { IndiKey } from "../types/types";
|
|
4
|
-
export declare const getFamilyWith: (person1: IndiType, person2?: IndiKey, famType?: "FAMS" | "FAMC") => FamType | undefined;
|
|
5
|
-
//# sourceMappingURL=get-family-with.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-family-with.d.ts","sourceRoot":"","sources":["../../src/utils/get-family-with.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,gBAAgB,CAAC;AAC5C,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,iBAAiB,CAAC;AAC9C,OAAO,KAAK,EAAC,OAAO,EAAC,MAAM,gBAAgB,CAAC;AAE5C,eAAO,MAAM,aAAa,GACzB,SAAS,QAAQ,EACjB,UAAU,OAAO,EACjB,UAAS,MAAM,GAAG,MAAe,KAY1B,OAAO,GAAG,SACjB,CAAC"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export const getFamilyWith = (person1, person2, famType = "FAMS") => {
|
|
2
|
-
return person1
|
|
3
|
-
?.get(famType)
|
|
4
|
-
?.toValueList()
|
|
5
|
-
.find((fam) => {
|
|
6
|
-
const family = fam;
|
|
7
|
-
return (famType === "FAMC" ||
|
|
8
|
-
family?.HUSB?.value === person2 ||
|
|
9
|
-
family?.WIFE?.value === person2);
|
|
10
|
-
});
|
|
11
|
-
};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type { Common } from "../classes/common";
|
|
2
|
-
import { List } from "../classes/list";
|
|
3
|
-
import type { Tag } from "../types/types";
|
|
4
|
-
export interface Place {
|
|
5
|
-
key: string;
|
|
6
|
-
index: number;
|
|
7
|
-
obj?: Common;
|
|
8
|
-
ref?: Common;
|
|
9
|
-
place?: string;
|
|
10
|
-
}
|
|
11
|
-
export declare enum PlaceType {
|
|
12
|
-
All = "ALL",
|
|
13
|
-
Birth = "BIRT",
|
|
14
|
-
Marriage = "MARR",
|
|
15
|
-
Death = "DEAT",
|
|
16
|
-
Events = "EVEN",
|
|
17
|
-
Military = "_MILT",
|
|
18
|
-
MilitaryId = "_MILTID"
|
|
19
|
-
}
|
|
20
|
-
export declare const getPlaces: (common: Common | List, type?: PlaceType | Tag | Array<PlaceType | Tag>, maxLevel?: number, level?: number, mainKey?: string) => Place[];
|
|
21
|
-
//# sourceMappingURL=get-places.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-places.d.ts","sourceRoot":"","sources":["../../src/utils/get-places.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AACvC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AAE1C,MAAM,WAAW,KAAK;IACrB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;CACf;AAED,oBAAY,SAAS;IACpB,GAAG,QAAQ;IACX,KAAK,SAAS;IACd,QAAQ,SAAS;IACjB,KAAK,SAAS;IACd,MAAM,SAAS;IACf,QAAQ,UAAU;IAClB,UAAU,YAAY;CACtB;AAED,eAAO,MAAM,SAAS,GACrB,QAAQ,MAAM,GAAG,IAAI,EACrB,OAAM,SAAS,GAAG,GAAG,GAAG,KAAK,CAAC,SAAS,GAAG,GAAG,CAAmB,EAChE,iBAAY,EACZ,cAAS,EACT,UAAU,MAAM,YA+EhB,CAAC"}
|
package/dist/utils/get-places.js
DELETED
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import { List } from "../classes/list.js";
|
|
2
|
-
export var PlaceType;
|
|
3
|
-
(function (PlaceType) {
|
|
4
|
-
PlaceType["All"] = "ALL";
|
|
5
|
-
PlaceType["Birth"] = "BIRT";
|
|
6
|
-
PlaceType["Marriage"] = "MARR";
|
|
7
|
-
PlaceType["Death"] = "DEAT";
|
|
8
|
-
PlaceType["Events"] = "EVEN";
|
|
9
|
-
PlaceType["Military"] = "_MILT";
|
|
10
|
-
PlaceType["MilitaryId"] = "_MILTID";
|
|
11
|
-
})(PlaceType || (PlaceType = {}));
|
|
12
|
-
export const getPlaces = (common, type = [PlaceType.All], maxLevel = 1, level = 0, mainKey) => {
|
|
13
|
-
const types = Array.isArray(type) ? type : [type];
|
|
14
|
-
const places = [];
|
|
15
|
-
if (!common?.toList || level > maxLevel) {
|
|
16
|
-
return places;
|
|
17
|
-
}
|
|
18
|
-
const commonList = common.toList();
|
|
19
|
-
commonList.forEach((item, _, index) => {
|
|
20
|
-
Object.entries(item).forEach(([key, value]) => {
|
|
21
|
-
if (!/^[_A-Z0-9]+$/.test(key)) {
|
|
22
|
-
return;
|
|
23
|
-
}
|
|
24
|
-
if (level === 0 &&
|
|
25
|
-
!types.includes(PlaceType.All) &&
|
|
26
|
-
((!types.includes(key) &&
|
|
27
|
-
[
|
|
28
|
-
PlaceType.Birth,
|
|
29
|
-
PlaceType.Marriage,
|
|
30
|
-
PlaceType.Death,
|
|
31
|
-
].includes(key)) ||
|
|
32
|
-
(!types.includes(PlaceType.Events) &&
|
|
33
|
-
![
|
|
34
|
-
PlaceType.Birth,
|
|
35
|
-
PlaceType.Marriage,
|
|
36
|
-
PlaceType.Death,
|
|
37
|
-
PlaceType.Military,
|
|
38
|
-
PlaceType.MilitaryId,
|
|
39
|
-
].includes(key)) ||
|
|
40
|
-
(!types.includes(PlaceType.Military) &&
|
|
41
|
-
!types.includes(PlaceType.MilitaryId) &&
|
|
42
|
-
![
|
|
43
|
-
PlaceType.Birth,
|
|
44
|
-
PlaceType.Marriage,
|
|
45
|
-
PlaceType.Death,
|
|
46
|
-
PlaceType.Events,
|
|
47
|
-
].includes(key)))) {
|
|
48
|
-
return;
|
|
49
|
-
}
|
|
50
|
-
if (key === "PLAC") {
|
|
51
|
-
value.toList().forEach((place) => {
|
|
52
|
-
places.push({
|
|
53
|
-
index,
|
|
54
|
-
place: place.toValue(),
|
|
55
|
-
obj: place,
|
|
56
|
-
key: mainKey || key,
|
|
57
|
-
});
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
else {
|
|
61
|
-
getPlaces(value, types, maxLevel, level + 1, mainKey || key).forEach((place) => {
|
|
62
|
-
const usedValue = value instanceof List
|
|
63
|
-
? value.index(place.index)
|
|
64
|
-
: value;
|
|
65
|
-
places.push({
|
|
66
|
-
place: place.place,
|
|
67
|
-
obj: usedValue,
|
|
68
|
-
ref: place.obj,
|
|
69
|
-
index: place.index,
|
|
70
|
-
key: place.key,
|
|
71
|
-
});
|
|
72
|
-
});
|
|
73
|
-
}
|
|
74
|
-
});
|
|
75
|
-
});
|
|
76
|
-
return places;
|
|
77
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-product-details.d.ts","sourceRoot":"","sources":["../../src/utils/get-product-details.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,aAAa,eAEzB,CAAC;AAEF,eAAO,MAAM,UAAU,cAAoB,CAAC;AAE5C,eAAO,MAAM,OAAO,cAAiB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"get-raw-size.d.ts","sourceRoot":"","sources":["../../src/utils/get-raw-size.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,GAAI,MAAM,MAAM,WAEtC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AACA,cAAc,SAAS,CAAC;AACxB,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,cAAc,CAAC;AAC7B,cAAc,uBAAuB,CAAC;AACtC,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,cAAc,UAAU,CAAC;AACzB,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,UAAU,CAAC;AACjD,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AAInC,YAAY,EAAE,cAAc,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAClE,cAAc,SAAS,CAAC"}
|
package/dist/utils/logger.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/utils/logger.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,WAAW,GAAI,MAAM,MAAM,EAAE,GAAG,MAAM,GAAG,EAAE,SAEvD,CAAC;AAEF,eAAO,MAAM,cAAc,GAAI,MAAM,MAAM,EAAE,GAAG,MAAM,GAAG,EAAE,SAG1D,CAAC"}
|
package/dist/utils/logger.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/* eslint-disable no-console */
|
|
2
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
3
|
-
const debugAll = false;
|
|
4
|
-
const debugError = true;
|
|
5
|
-
export const implemented = (type, ...args) => {
|
|
6
|
-
debugAll && console.info(`[Implemented] ${type}`, ...args);
|
|
7
|
-
};
|
|
8
|
-
export const notImplemented = (type, ...args) => {
|
|
9
|
-
(debugAll || debugError) &&
|
|
10
|
-
console.error(`[Not Implemented] ${type}`, ...args);
|
|
11
|
-
};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { IndiType } from "../classes/indi";
|
|
2
|
-
import type { Settings } from "../types/settings";
|
|
3
|
-
export declare const nameFormatter: (indiName?: IndiType | string, settings?: Partial<Settings>, letterOnAll?: boolean, indi?: IndiType, debug?: 3) => {
|
|
4
|
-
suffix: string;
|
|
5
|
-
givenname: string;
|
|
6
|
-
surname: string;
|
|
7
|
-
inOrder: [string, string, string];
|
|
8
|
-
letter: string;
|
|
9
|
-
};
|
|
10
|
-
//# sourceMappingURL=name-formatter.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"name-formatter.d.ts","sourceRoot":"","sources":["../../src/utils/name-formatter.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,iBAAiB,CAAC;AAG9C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAElD,eAAO,MAAM,aAAa,GACzB,WAAW,QAAQ,GAAG,MAAM,EAC5B,WAAW,OAAO,CAAC,QAAQ,CAAC,EAC5B,qBAAkB,EAClB,OAAO,QAAQ,EACf,QAAQ,CAAC;;;;;;CAyDT,CAAC"}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { Indi } from "../classes/indi.js";
|
|
2
|
-
import { createCommonName } from "../classes/name.js";
|
|
3
|
-
export const nameFormatter = (indiName, settings, letterOnAll = true, indi, debug) => {
|
|
4
|
-
const { nameOrder = "first-last", maxGivennames = 0, maxSurnames = 0, } = settings ?? {};
|
|
5
|
-
const rawName = indiName instanceof Indi
|
|
6
|
-
? indiName?.NAME
|
|
7
|
-
: createCommonName(undefined, undefined, indi).name(indiName);
|
|
8
|
-
const name = rawName?.toList().index(0);
|
|
9
|
-
let givenname = name?.GIVN?.toValueList().first()?.value || "";
|
|
10
|
-
let surname = name?.SURN?.toValueList().first()?.value || "";
|
|
11
|
-
let suffix = name?.NSFX?.toValueList().first()?.value || "";
|
|
12
|
-
const displayedName = name?.DISPLAY?.toValueList().first()?.value || "";
|
|
13
|
-
if (!givenname && !surname) {
|
|
14
|
-
givenname = displayedName;
|
|
15
|
-
}
|
|
16
|
-
if (maxGivennames > 0) {
|
|
17
|
-
givenname = givenname.split(" ").slice(0, maxGivennames).join(" ");
|
|
18
|
-
}
|
|
19
|
-
if (maxSurnames > 0) {
|
|
20
|
-
surname = surname.split(" ").slice(0, maxSurnames).join(" ");
|
|
21
|
-
}
|
|
22
|
-
if (debug) {
|
|
23
|
-
suffix = suffix || "Dr";
|
|
24
|
-
for (let i = 1; i < debug; i++) {
|
|
25
|
-
givenname = `${givenname} ${givenname}`;
|
|
26
|
-
surname = `${surname} ${surname}`;
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
const inOrder = [
|
|
30
|
-
suffix,
|
|
31
|
-
...(nameOrder === "last-first"
|
|
32
|
-
? [surname, givenname]
|
|
33
|
-
: [givenname, surname]),
|
|
34
|
-
];
|
|
35
|
-
const lName = (letterOnAll
|
|
36
|
-
? [inOrder[1], inOrder[2]].filter(Boolean).join(" ")
|
|
37
|
-
: inOrder[1]).toLowerCase();
|
|
38
|
-
const firstLetter = lName.match(/^(dzs|cs|dz|gy|ly|ny|sz|ty|zs|\w)/i)?.[0] ??
|
|
39
|
-
lName.substring(0, 1) ??
|
|
40
|
-
"";
|
|
41
|
-
const validFirstLetter = `${firstLetter
|
|
42
|
-
.substring(0, 1)
|
|
43
|
-
.toUpperCase()}${firstLetter.substring(1)}`;
|
|
44
|
-
return { suffix, givenname, surname, inOrder, letter: validFirstLetter };
|
|
45
|
-
};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import type { Individuals } from "../classes/indis";
|
|
2
|
-
import type { NestedGroup } from "../types/types";
|
|
3
|
-
export declare const setNestedGroup: (obj: NestedGroup, key: string | string[], value: Individuals, uniqueCounting?: boolean) => void;
|
|
4
|
-
//# sourceMappingURL=nested-group.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"nested-group.d.ts","sourceRoot":"","sources":["../../src/utils/nested-group.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAKlD,eAAO,MAAM,cAAc,GAC1B,KAAK,WAAW,EAChB,KAAK,MAAM,GAAG,MAAM,EAAE,EACtB,OAAO,WAAW,EAClB,wBAAqB,SAmCrB,CAAC"}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import get from "lodash-es/get.js";
|
|
2
|
-
import set from "lodash-es/set.js";
|
|
3
|
-
import { Individuals as IndividualsClass } from "../classes/indis.js";
|
|
4
|
-
// Use a WeakMap to track unique items for each node without polluting the object
|
|
5
|
-
const uniqueItemsCache = new WeakMap();
|
|
6
|
-
export const setNestedGroup = (obj, key, value, uniqueCounting = true) => {
|
|
7
|
-
const parts = Array.isArray(key) ? key : key.split(/,\s*/);
|
|
8
|
-
// Set items only at the leaf level (deepest level of this path)
|
|
9
|
-
set(obj, [...parts, "items"], value);
|
|
10
|
-
// Update lengths at all parent levels by tracking unique items incrementally
|
|
11
|
-
parts.forEach((_, index) => {
|
|
12
|
-
if (!uniqueCounting) {
|
|
13
|
-
// If not unique counting, simply set the length to the number of items at this level
|
|
14
|
-
const key = [...parts.toSpliced(index + 1), "length"];
|
|
15
|
-
const length = get(obj, key);
|
|
16
|
-
set(obj, key, (length ?? 0) + value.length);
|
|
17
|
-
return;
|
|
18
|
-
}
|
|
19
|
-
const pathKey = [...parts.toSpliced(index + 1)];
|
|
20
|
-
const node = get(obj, pathKey);
|
|
21
|
-
if (node) {
|
|
22
|
-
// Get or create the unique items collection for this node
|
|
23
|
-
let uniqueItems = uniqueItemsCache.get(node);
|
|
24
|
-
if (!uniqueItems) {
|
|
25
|
-
uniqueItems = new IndividualsClass();
|
|
26
|
-
uniqueItemsCache.set(node, uniqueItems);
|
|
27
|
-
}
|
|
28
|
-
// Merge the new items to track unique individuals
|
|
29
|
-
uniqueItems.merge(value);
|
|
30
|
-
// Update the length to be the count of unique items
|
|
31
|
-
set(obj, [...pathKey, "length"], uniqueItems.length);
|
|
32
|
-
}
|
|
33
|
-
});
|
|
34
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ordinalize.d.ts","sourceRoot":"","sources":["../../src/utils/ordinalize.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU,GAAI,GAAG,MAAM,KAAG,MAsBtC,CAAC;AAeF,eAAO,MAAM,mBAAmB,GAAI,GAAG,MAAM,WAqF5C,CAAC"}
|
package/dist/utils/ordinalize.js
DELETED
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
export const ordinalize = (n) => {
|
|
2
|
-
const num = Math.round(n);
|
|
3
|
-
const numString = num.toString();
|
|
4
|
-
// If the ten's place is 1, the suffix is always "th"
|
|
5
|
-
// (10th, 11th, 12th, 13th, 14th, 111th, 112th, etc.)
|
|
6
|
-
if (Math.floor(num / 10) % 10 === 1) {
|
|
7
|
-
return numString + "th";
|
|
8
|
-
}
|
|
9
|
-
// Otherwise, the suffix depends on the one's place as follows
|
|
10
|
-
// (1st, 2nd, 3rd, 4th, 21st, 22nd, etc.)
|
|
11
|
-
switch (num % 10) {
|
|
12
|
-
case 1:
|
|
13
|
-
return numString + "st";
|
|
14
|
-
case 2:
|
|
15
|
-
return numString + "nd";
|
|
16
|
-
case 3:
|
|
17
|
-
return numString + "rd";
|
|
18
|
-
default:
|
|
19
|
-
return numString + "th";
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
export const hungarianOrdinalize = (n) => {
|
|
23
|
-
const numberPrefix = [
|
|
24
|
-
"",
|
|
25
|
-
"",
|
|
26
|
-
"két",
|
|
27
|
-
"három",
|
|
28
|
-
"négy",
|
|
29
|
-
"öt",
|
|
30
|
-
"hat",
|
|
31
|
-
"hét",
|
|
32
|
-
"nyolc",
|
|
33
|
-
"kilenc",
|
|
34
|
-
];
|
|
35
|
-
const ordinals = [
|
|
36
|
-
[
|
|
37
|
-
"",
|
|
38
|
-
["első", "egyed"],
|
|
39
|
-
["másod", "ketted"],
|
|
40
|
-
"harmad",
|
|
41
|
-
"negyed",
|
|
42
|
-
"ötöd",
|
|
43
|
-
"hatod",
|
|
44
|
-
"heted",
|
|
45
|
-
"nyolcad",
|
|
46
|
-
"kilenced",
|
|
47
|
-
],
|
|
48
|
-
[
|
|
49
|
-
"",
|
|
50
|
-
["tized", "tizen"],
|
|
51
|
-
["huszad", "huszon"],
|
|
52
|
-
"harmincad",
|
|
53
|
-
"negyvened",
|
|
54
|
-
"ötvened",
|
|
55
|
-
"hatvanad",
|
|
56
|
-
"hetvened",
|
|
57
|
-
"nyolcvanad",
|
|
58
|
-
"kilencvened",
|
|
59
|
-
],
|
|
60
|
-
"század",
|
|
61
|
-
["ezred", "ezer"],
|
|
62
|
-
];
|
|
63
|
-
const parts = [];
|
|
64
|
-
let fractionIndex = 0;
|
|
65
|
-
let fractions = 1;
|
|
66
|
-
let nr = Math.abs(n);
|
|
67
|
-
let part;
|
|
68
|
-
do {
|
|
69
|
-
const nextFractions = fractions * 10;
|
|
70
|
-
const index = fractions > 1
|
|
71
|
-
? (nr % nextFractions) / fractions
|
|
72
|
-
: nr % nextFractions;
|
|
73
|
-
const ordinalList = ordinals[fractionIndex++];
|
|
74
|
-
if (typeof ordinalList === "string") {
|
|
75
|
-
part = `${numberPrefix[index]}${ordinalList}`;
|
|
76
|
-
}
|
|
77
|
-
else if (ordinalList.length === 2) {
|
|
78
|
-
part = ordinalList;
|
|
79
|
-
}
|
|
80
|
-
else {
|
|
81
|
-
part = ordinalList?.[index];
|
|
82
|
-
}
|
|
83
|
-
if (Array.isArray(part)) {
|
|
84
|
-
if (fractions === 1) {
|
|
85
|
-
part = part[nr < 10 ? 0 : 1];
|
|
86
|
-
}
|
|
87
|
-
else {
|
|
88
|
-
part = part[n % 10 === 0 ? 0 : 1];
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
else if (fractions > 1 && n % 10 !== 0) {
|
|
92
|
-
part = part?.substring(0, part.length - 2);
|
|
93
|
-
}
|
|
94
|
-
if (part !== undefined) {
|
|
95
|
-
parts.unshift(part);
|
|
96
|
-
}
|
|
97
|
-
fractions = nextFractions;
|
|
98
|
-
nr = Math.floor(nr / nextFractions) * nextFractions;
|
|
99
|
-
if (nr < nextFractions) {
|
|
100
|
-
break;
|
|
101
|
-
}
|
|
102
|
-
} while (part !== undefined);
|
|
103
|
-
return parts.join("");
|
|
104
|
-
};
|
package/dist/utils/parser.d.ts
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { Common } from "../classes/common";
|
|
2
|
-
import type { Settings } from "../types/settings";
|
|
3
|
-
import type { MultiTag } from "../types/types";
|
|
4
|
-
declare const GedcomTree: {
|
|
5
|
-
parse: (content: string, options?: {
|
|
6
|
-
settings?: Settings;
|
|
7
|
-
}) => any;
|
|
8
|
-
parseHierarchy: (content: string, options?: {
|
|
9
|
-
settings?: Settings;
|
|
10
|
-
}) => {
|
|
11
|
-
gedcom: import("../classes/gedcom").GedComType;
|
|
12
|
-
raw: string;
|
|
13
|
-
};
|
|
14
|
-
addToList: (id: string, type: MultiTag, common: Common, prev: Common) => void;
|
|
15
|
-
};
|
|
16
|
-
export default GedcomTree;
|
|
17
|
-
//# sourceMappingURL=parser.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"parser.d.ts","sourceRoot":"","sources":["../../src/utils/parser.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAoB,MAAM,mBAAmB,CAAC;AAgB7D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,KAAK,EAAuB,QAAQ,EAAW,MAAM,gBAAgB,CAAC;AAsD7E,QAAA,MAAM,UAAU;qBACW,MAAM,YAAY;QAAE,QAAQ,CAAC,EAAE,QAAQ,CAAA;KAAE;8BAIzD,MAAM,YACL;QAAE,QAAQ,CAAC,EAAE,QAAQ,CAAA;KAAE;;;;oBAsQ7B,MAAM,QACJ,QAAQ,UACN,MAAM,QACR,MAAM;CAuBb,CAAC;AAOF,eAAe,UAAU,CAAC"}
|