@treeviz/gedcom-parser 2.1.8 → 2.1.9

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.
@@ -79,7 +79,9 @@ __export(translators_exports, {
79
79
  es: () => KinshipTranslatorEs,
80
80
  fr: () => KinshipTranslatorFr,
81
81
  hu: () => KinshipTranslatorHU,
82
- ru: () => KinshipTranslatorRu
82
+ ja: () => KinshipTranslatorJa,
83
+ ru: () => KinshipTranslatorRu,
84
+ zh: () => KinshipTranslatorZh
83
85
  });
84
86
 
85
87
  // src/constants/constants.ts
@@ -2876,6 +2878,445 @@ var KinshipTranslatorRu = class extends KinshipTranslatorBasic {
2876
2878
  }
2877
2879
  };
2878
2880
 
2881
+ // src/kinship-translator/patterns.ja.ts
2882
+ var InLawsJa = {
2883
+ "(\u5B50|\u5A18|\u606F\u5B50)\u306E\u914D\u5076\u8005": "\u7FA9\u7406\u306E\u5B50",
2884
+ "(\u5B50|\u5A18|\u606F\u5B50)\u306E\u59BB": "\u5AC1",
2885
+ "(\u5B50|\u5A18|\u606F\u5B50)\u306E\u592B": "\u5A7F",
2886
+ "(\u914D\u5076\u8005|\u59BB|\u592B)\u306E\u6BCD": "\u7FA9\u6BCD",
2887
+ "(\u914D\u5076\u8005|\u59BB|\u592B)\u306E\u7236": "\u7FA9\u7236",
2888
+ "(\u914D\u5076\u8005|\u59BB|\u592B)\u306E\u89AA": "\u7FA9\u7406\u306E\u89AA",
2889
+ "(\u7570\u7236\u6BCD\u306E)?(\u5144\u5F1F|\u59C9\u59B9|\u5144\u5F1F\u59C9\u59B9)\u306E\u59BB": "\u7FA9\u7406\u306E\u59C9\u59B9",
2890
+ "(\u7570\u7236\u6BCD\u306E)?(\u5144\u5F1F|\u59C9\u59B9|\u5144\u5F1F\u59C9\u59B9)\u306E\u592B": "\u7FA9\u7406\u306E\u5144\u5F1F",
2891
+ "(\u7570\u7236\u6BCD\u306E)?(\u5144\u5F1F|\u59C9\u59B9|\u5144\u5F1F\u59C9\u59B9)\u306E\u914D\u5076\u8005": "\u7FA9\u7406\u306E\u5144\u5F1F\u59C9\u59B9",
2892
+ "(\u7570\u7236\u6BCD\u306E)?\u59C9\u59B9\u306E(\u914D\u5076\u8005|\u59BB|\u592B)": "\u7FA9\u7406\u306E\u59C9\u59B9",
2893
+ "(\u7570\u7236\u6BCD\u306E)?\u5144\u5F1F\u306E(\u914D\u5076\u8005|\u59BB|\u592B)": "\u7FA9\u7406\u306E\u5144\u5F1F",
2894
+ "(\u7570\u7236\u6BCD\u306E)?\u5144\u5F1F\u59C9\u59B9\u306E(\u914D\u5076\u8005|\u59BB|\u592B)": "\u7FA9\u7406\u306E\u5144\u5F1F\u59C9\u59B9",
2895
+ "(\u7570\u7236\u6BCD\u306E)?(\u914D\u5076\u8005|\u59BB|\u592B)\u306E\u59C9\u59B9": "\u7FA9\u7406\u306E\u59C9\u59B9",
2896
+ "(\u7570\u7236\u6BCD\u306E)?(\u914D\u5076\u8005|\u59BB|\u592B)\u306E\u5144\u5F1F": "\u7FA9\u7406\u306E\u5144\u5F1F",
2897
+ "(\u7570\u7236\u6BCD\u306E)?(\u914D\u5076\u8005|\u59BB|\u592B)\u306E\u5144\u5F1F\u59C9\u59B9": "\u7FA9\u7406\u306E\u5144\u5F1F\u59C9\u59B9"
2898
+ };
2899
+
2900
+ // src/kinship-translator/kinship-translator.ja.ts
2901
+ var sexOf2 = (person) => {
2902
+ if (person?.isMale?.()) {
2903
+ return "m";
2904
+ }
2905
+ if (person?.isFemale?.()) {
2906
+ return "f";
2907
+ }
2908
+ return "n";
2909
+ };
2910
+ var pick = (sex, male, female, neutral) => {
2911
+ if (sex === "m") {
2912
+ return male;
2913
+ }
2914
+ if (sex === "f") {
2915
+ return female;
2916
+ }
2917
+ return neutral;
2918
+ };
2919
+ var lineal = (level, sex, kind) => {
2920
+ const L = Math.max(1, level);
2921
+ if (kind === "asc") {
2922
+ if (L <= 1) {
2923
+ return pick(sex, "\u7236", "\u6BCD", "\u89AA");
2924
+ }
2925
+ if (L === 2) {
2926
+ return pick(sex, "\u7956\u7236", "\u7956\u6BCD", "\u7956\u7236\u6BCD");
2927
+ }
2928
+ if (L === 3) {
2929
+ return pick(sex, "\u66FE\u7956\u7236", "\u66FE\u7956\u6BCD", "\u66FE\u7956\u7236\u6BCD");
2930
+ }
2931
+ if (L === 4) {
2932
+ return pick(sex, "\u9AD8\u7956\u7236", "\u9AD8\u7956\u6BCD", "\u9AD8\u7956\u7236\u6BCD");
2933
+ }
2934
+ return pick(
2935
+ sex,
2936
+ `${L - 1}\u4E16\u306E\u7956\u7236`,
2937
+ `${L - 1}\u4E16\u306E\u7956\u6BCD`,
2938
+ `${L - 1}\u4E16\u306E\u7956\u7236\u6BCD`
2939
+ );
2940
+ }
2941
+ if (L <= 1) {
2942
+ return pick(sex, "\u606F\u5B50", "\u5A18", "\u5B50");
2943
+ }
2944
+ if (L === 2) {
2945
+ return "\u5B6B";
2946
+ }
2947
+ if (L === 3) {
2948
+ return "\u66FE\u5B6B";
2949
+ }
2950
+ if (L === 4) {
2951
+ return "\u7384\u5B6B";
2952
+ }
2953
+ return `${L - 1}\u4E16\u306E\u5B6B`;
2954
+ };
2955
+ var cousinPlain = (degree) => {
2956
+ if (degree <= 1) {
2957
+ return "\u3044\u3068\u3053";
2958
+ }
2959
+ if (degree === 2) {
2960
+ return "\u307E\u305F\u3044\u3068\u3053";
2961
+ }
2962
+ if (degree === 3) {
2963
+ return "\u306F\u3068\u3053";
2964
+ }
2965
+ return `${degree}\u89AA\u7B49\u306E\u3044\u3068\u3053`;
2966
+ };
2967
+ var KinshipTranslatorJa = class extends KinshipTranslatorBasic {
2968
+ indirect() {
2969
+ let degree = Math.abs(this.pathN?.degree ?? 0);
2970
+ if (degree > 0) {
2971
+ degree = degree - 1;
2972
+ }
2973
+ return cousinPlain(degree);
2974
+ }
2975
+ removal() {
2976
+ const level = this.pathN?.level ?? 0;
2977
+ let degree = Math.abs(this.pathN?.degree ?? 0);
2978
+ if (degree > 0) {
2979
+ degree = degree - 1;
2980
+ }
2981
+ if (!degree) {
2982
+ return level < 0 ? this.nibling() : this.auncle();
2983
+ }
2984
+ const removed = Math.abs(level);
2985
+ return `${cousinPlain(degree)}\uFF08${removed}\u4E16\u4EE3\u9055\u3044\uFF09`;
2986
+ }
2987
+ auncle() {
2988
+ const level = Math.abs(this.pathN?.level ?? 0);
2989
+ const sex = sexOf2(this.personN);
2990
+ if (level <= 2) {
2991
+ return pick(sex, "\u304A\u3058", "\u304A\u3070", "\u304A\u3058/\u304A\u3070");
2992
+ }
2993
+ if (level === 3) {
2994
+ return pick(sex, "\u5927\u304A\u3058", "\u5927\u304A\u3070", "\u5927\u304A\u3058/\u5927\u304A\u3070");
2995
+ }
2996
+ return pick(
2997
+ sex,
2998
+ `${level - 2}\u4EE3\u524D\u306E\u304A\u3058`,
2999
+ `${level - 2}\u4EE3\u524D\u306E\u304A\u3070`,
3000
+ `${level - 2}\u4EE3\u524D\u306E\u304A\u3058/\u304A\u3070`
3001
+ );
3002
+ }
3003
+ nibling() {
3004
+ const level = Math.abs(this.pathN?.level ?? 0);
3005
+ const sex = sexOf2(this.personN);
3006
+ if (level <= 2) {
3007
+ return pick(sex, "\u7525", "\u59EA", "\u7525/\u59EA");
3008
+ }
3009
+ if (level === 3) {
3010
+ return pick(sex, "\u5927\u7525", "\u5927\u59EA", "\u5927\u7525/\u5927\u59EA");
3011
+ }
3012
+ return pick(
3013
+ sex,
3014
+ `${level - 2}\u4EE3\u4E0B\u306E\u7525`,
3015
+ `${level - 2}\u4EE3\u4E0B\u306E\u59EA`,
3016
+ `${level - 2}\u4EE3\u4E0B\u306E\u7525/\u59EA`
3017
+ );
3018
+ }
3019
+ parent() {
3020
+ return lineal(
3021
+ Math.abs(this.pathN?.level ?? 0),
3022
+ sexOf2(this.personN),
3023
+ "asc"
3024
+ );
3025
+ }
3026
+ child() {
3027
+ return lineal(
3028
+ Math.abs(this.pathN?.level ?? 0),
3029
+ sexOf2(this.personN),
3030
+ "desc"
3031
+ );
3032
+ }
3033
+ sibling() {
3034
+ return pick(sexOf2(this.personN), "\u5144\u5F1F", "\u59C9\u59B9", "\u5144\u5F1F\u59C9\u59B9");
3035
+ }
3036
+ halfBlood(relation) {
3037
+ if (!relation || !this.isHalfBlood) {
3038
+ return relation ?? "";
3039
+ }
3040
+ return `\u7570\u7236\u6BCD\u306E${relation}`;
3041
+ }
3042
+ spouse() {
3043
+ return pick(sexOf2(this.personN), "\u592B", "\u59BB", "\u914D\u5076\u8005");
3044
+ }
3045
+ ofSpouse(relation) {
3046
+ if (!relation) {
3047
+ return "";
3048
+ }
3049
+ const spouseType = pick(
3050
+ sexOf2(this.path?.[1].indi),
3051
+ "\u592B",
3052
+ "\u59BB",
3053
+ "\u914D\u5076\u8005"
3054
+ );
3055
+ return `${spouseType}\u306E${relation}`;
3056
+ }
3057
+ spouseOf(relation) {
3058
+ if (!relation) {
3059
+ return "";
3060
+ }
3061
+ const spouse = this.path?.[this.path.length - 1].indi;
3062
+ const spouseType = pick(sexOf2(spouse), "\u592B", "\u59BB", "\u914D\u5076\u8005");
3063
+ return `${relation}\u306E${spouseType}`;
3064
+ }
3065
+ of(relation) {
3066
+ const formattedName = nameFormatter(this.path?.[0]?.indi, {
3067
+ nameOrder: "last-first"
3068
+ });
3069
+ let name = formattedName.inOrder.filter(Boolean).join(" ");
3070
+ if (this.displayName === "none") {
3071
+ name = "";
3072
+ } else if (this.displayName === "givenname") {
3073
+ name = formattedName.givenname;
3074
+ } else if (this.displayName === "surname") {
3075
+ name = `${formattedName.surname}`;
3076
+ }
3077
+ if (!name || !relation) {
3078
+ return relation ?? "";
3079
+ }
3080
+ return `${name}\u306E${relation}`;
3081
+ }
3082
+ inLaw(relation) {
3083
+ let inLawRelation = relation;
3084
+ Object.keys(InLawsJa).find((pattern) => {
3085
+ const regex = new RegExp(`^${pattern}$`);
3086
+ if (relation?.match(regex)) {
3087
+ inLawRelation = InLawsJa[pattern];
3088
+ return true;
3089
+ }
3090
+ return false;
3091
+ });
3092
+ return inLawRelation ?? "";
3093
+ }
3094
+ relationType(relation) {
3095
+ if (!relation || !this.pathN?.relation) {
3096
+ return relation ?? "";
3097
+ }
3098
+ return `${this.pathN.relation}\u306E${relation}`;
3099
+ }
3100
+ };
3101
+
3102
+ // src/kinship-translator/patterns.zh.ts
3103
+ var InLawsZh = {
3104
+ "(\u5B50\u5973|\u5973\u513F|\u513F\u5B50)\u7684\u914D\u5076": "\u513F\u5AB3/\u5973\u5A7F",
3105
+ "(\u5B50\u5973|\u5973\u513F|\u513F\u5B50)\u7684\u59BB\u5B50": "\u513F\u5AB3",
3106
+ "(\u5B50\u5973|\u5973\u513F|\u513F\u5B50)\u7684\u4E08\u592B": "\u5973\u5A7F",
3107
+ "(\u914D\u5076|\u59BB\u5B50|\u4E08\u592B)\u7684\u6BCD\u4EB2": "\u5CB3\u6BCD/\u5A46\u5A46",
3108
+ "(\u914D\u5076|\u59BB\u5B50|\u4E08\u592B)\u7684\u7236\u4EB2": "\u5CB3\u7236/\u516C\u516C",
3109
+ "(\u914D\u5076|\u59BB\u5B50|\u4E08\u592B)\u7684\u7236\u6BCD": "\u5CB3\u7236\u5CB3\u6BCD/\u516C\u516C\u5A46\u5A46",
3110
+ "(\u5F02\u7236\u6BCD\u7684)?(\u5144\u5F1F\u59D0\u59B9|\u59D0\u59B9|\u5144\u5F1F)\u7684\u59BB\u5B50": "\u5AC2\u5B50/\u5F1F\u59B9",
3111
+ "(\u5F02\u7236\u6BCD\u7684)?(\u5144\u5F1F\u59D0\u59B9|\u59D0\u59B9|\u5144\u5F1F)\u7684\u4E08\u592B": "\u59D0\u592B/\u59B9\u592B",
3112
+ "(\u5F02\u7236\u6BCD\u7684)?(\u5144\u5F1F\u59D0\u59B9|\u59D0\u59B9|\u5144\u5F1F)\u7684\u914D\u5076": "\u59FB\u4EB2\u5144\u5F1F\u59D0\u59B9",
3113
+ "(\u5F02\u7236\u6BCD\u7684)?\u59D0\u59B9\u7684(\u914D\u5076|\u59BB\u5B50|\u4E08\u592B)": "\u59D0\u592B/\u59B9\u592B",
3114
+ "(\u5F02\u7236\u6BCD\u7684)?\u5144\u5F1F\u7684(\u914D\u5076|\u59BB\u5B50|\u4E08\u592B)": "\u5AC2\u5B50/\u5F1F\u59B9",
3115
+ "(\u5F02\u7236\u6BCD\u7684)?\u5144\u5F1F\u59D0\u59B9\u7684(\u914D\u5076|\u59BB\u5B50|\u4E08\u592B)": "\u59FB\u4EB2\u5144\u5F1F\u59D0\u59B9",
3116
+ "(\u5F02\u7236\u6BCD\u7684)?(\u914D\u5076|\u59BB\u5B50|\u4E08\u592B)\u7684\u59D0\u59B9": "\u59D1\u5B50/\u59E8\u5B50",
3117
+ "(\u5F02\u7236\u6BCD\u7684)?(\u914D\u5076|\u59BB\u5B50|\u4E08\u592B)\u7684\u5144\u5F1F": "\u5927\u4F2F/\u5C0F\u53D4/\u5185\u5144/\u5185\u5F1F",
3118
+ "(\u5F02\u7236\u6BCD\u7684)?(\u914D\u5076|\u59BB\u5B50|\u4E08\u592B)\u7684\u5144\u5F1F\u59D0\u59B9": "\u59FB\u4EB2\u5144\u5F1F\u59D0\u59B9"
3119
+ };
3120
+
3121
+ // src/kinship-translator/kinship-translator.zh.ts
3122
+ var sexOf3 = (person) => {
3123
+ if (person?.isMale?.()) {
3124
+ return "m";
3125
+ }
3126
+ if (person?.isFemale?.()) {
3127
+ return "f";
3128
+ }
3129
+ return "n";
3130
+ };
3131
+ var pick2 = (sex, male, female, neutral) => {
3132
+ if (sex === "m") {
3133
+ return male;
3134
+ }
3135
+ if (sex === "f") {
3136
+ return female;
3137
+ }
3138
+ return neutral;
3139
+ };
3140
+ var lineal2 = (level, sex, kind) => {
3141
+ const L = Math.max(1, level);
3142
+ if (kind === "asc") {
3143
+ if (L <= 1) {
3144
+ return pick2(sex, "\u7236\u4EB2", "\u6BCD\u4EB2", "\u7236\u6BCD");
3145
+ }
3146
+ if (L === 2) {
3147
+ return pick2(sex, "\u7956\u7236", "\u7956\u6BCD", "\u7956\u7236\u6BCD");
3148
+ }
3149
+ if (L === 3) {
3150
+ return pick2(sex, "\u66FE\u7956\u7236", "\u66FE\u7956\u6BCD", "\u66FE\u7956\u7236\u6BCD");
3151
+ }
3152
+ if (L === 4) {
3153
+ return pick2(sex, "\u9AD8\u7956\u7236", "\u9AD8\u7956\u6BCD", "\u9AD8\u7956\u7236\u6BCD");
3154
+ }
3155
+ return pick2(sex, `${L}\u4E16\u7956`, `${L}\u4E16\u7956\u6BCD`, `${L}\u4E16\u7956\u7236\u6BCD`);
3156
+ }
3157
+ if (L <= 1) {
3158
+ return pick2(sex, "\u513F\u5B50", "\u5973\u513F", "\u5B50\u5973");
3159
+ }
3160
+ if (L === 2) {
3161
+ return pick2(sex, "\u5B59\u5B50", "\u5B59\u5973", "\u5B59\u5B50\u5973");
3162
+ }
3163
+ if (L === 3) {
3164
+ return pick2(sex, "\u66FE\u5B59", "\u66FE\u5B59\u5973", "\u66FE\u5B59\u5B50\u5973");
3165
+ }
3166
+ if (L === 4) {
3167
+ return pick2(sex, "\u7384\u5B59", "\u7384\u5B59\u5973", "\u7384\u5B59\u5B50\u5973");
3168
+ }
3169
+ return pick2(sex, `${L}\u4E16\u5B59`, `${L}\u4E16\u5B59\u5973`, `${L}\u4E16\u5B59\u5B50\u5973`);
3170
+ };
3171
+ var cousinPlain2 = (degree, sex) => {
3172
+ if (degree <= 1) {
3173
+ return pick2(sex, "\u5802\u8868\u5144\u5F1F", "\u5802\u8868\u59D0\u59B9", "\u5802\u8868\u4EB2");
3174
+ }
3175
+ if (degree === 2) {
3176
+ return pick2(sex, "\u4ECE\u5802\u8868\u5144\u5F1F", "\u4ECE\u5802\u8868\u59D0\u59B9", "\u4ECE\u5802\u8868\u4EB2");
3177
+ }
3178
+ return pick2(
3179
+ sex,
3180
+ `${degree}\u4EE3\u5802\u8868\u5144\u5F1F`,
3181
+ `${degree}\u4EE3\u5802\u8868\u59D0\u59B9`,
3182
+ `${degree}\u4EE3\u5802\u8868\u4EB2`
3183
+ );
3184
+ };
3185
+ var KinshipTranslatorZh = class extends KinshipTranslatorBasic {
3186
+ indirect() {
3187
+ let degree = Math.abs(this.pathN?.degree ?? 0);
3188
+ if (degree > 0) {
3189
+ degree = degree - 1;
3190
+ }
3191
+ return cousinPlain2(degree, sexOf3(this.personN));
3192
+ }
3193
+ removal() {
3194
+ const level = this.pathN?.level ?? 0;
3195
+ let degree = Math.abs(this.pathN?.degree ?? 0);
3196
+ if (degree > 0) {
3197
+ degree = degree - 1;
3198
+ }
3199
+ if (!degree) {
3200
+ return level < 0 ? this.nibling() : this.auncle();
3201
+ }
3202
+ const removed = Math.abs(level);
3203
+ return `${cousinPlain2(degree, sexOf3(this.personN))}\uFF08\u9694${removed}\u4EE3\uFF09`;
3204
+ }
3205
+ auncle() {
3206
+ const level = Math.abs(this.pathN?.level ?? 0);
3207
+ const sex = sexOf3(this.personN);
3208
+ if (level <= 2) {
3209
+ return pick2(sex, "\u53D4\u53D4", "\u963F\u59E8", "\u53D4\u4F2F/\u59D1\u59E8");
3210
+ }
3211
+ if (level === 3) {
3212
+ return pick2(sex, "\u4F2F\u53D4\u7956\u7236", "\u59D1\u7956\u6BCD", "\u4F2F\u53D4\u7956\u7236\u6BCD");
3213
+ }
3214
+ return pick2(
3215
+ sex,
3216
+ `${level - 2}\u4EE3\u524D\u7684\u53D4\u53D4`,
3217
+ `${level - 2}\u4EE3\u524D\u7684\u963F\u59E8`,
3218
+ `${level - 2}\u4EE3\u524D\u7684\u53D4\u4F2F/\u59D1\u59E8`
3219
+ );
3220
+ }
3221
+ nibling() {
3222
+ const level = Math.abs(this.pathN?.level ?? 0);
3223
+ const sex = sexOf3(this.personN);
3224
+ if (level <= 2) {
3225
+ return pick2(sex, "\u4F84\u5B50", "\u4F84\u5973", "\u4F84\u5B50\u5973");
3226
+ }
3227
+ if (level === 3) {
3228
+ return pick2(sex, "\u4F84\u5B59", "\u4F84\u5B59\u5973", "\u4F84\u5B59\u5B50\u5973");
3229
+ }
3230
+ return pick2(
3231
+ sex,
3232
+ `${level - 2}\u4EE3\u4E0B\u7684\u4F84\u5B50`,
3233
+ `${level - 2}\u4EE3\u4E0B\u7684\u4F84\u5973`,
3234
+ `${level - 2}\u4EE3\u4E0B\u7684\u4F84\u5B50\u5973`
3235
+ );
3236
+ }
3237
+ parent() {
3238
+ return lineal2(
3239
+ Math.abs(this.pathN?.level ?? 0),
3240
+ sexOf3(this.personN),
3241
+ "asc"
3242
+ );
3243
+ }
3244
+ child() {
3245
+ return lineal2(
3246
+ Math.abs(this.pathN?.level ?? 0),
3247
+ sexOf3(this.personN),
3248
+ "desc"
3249
+ );
3250
+ }
3251
+ sibling() {
3252
+ return pick2(sexOf3(this.personN), "\u5144\u5F1F", "\u59D0\u59B9", "\u5144\u5F1F\u59D0\u59B9");
3253
+ }
3254
+ halfBlood(relation) {
3255
+ if (!relation || !this.isHalfBlood) {
3256
+ return relation ?? "";
3257
+ }
3258
+ return `\u5F02\u7236\u6BCD\u7684${relation}`;
3259
+ }
3260
+ spouse() {
3261
+ return pick2(sexOf3(this.personN), "\u4E08\u592B", "\u59BB\u5B50", "\u914D\u5076");
3262
+ }
3263
+ ofSpouse(relation) {
3264
+ if (!relation) {
3265
+ return "";
3266
+ }
3267
+ const spouseType = pick2(
3268
+ sexOf3(this.path?.[1].indi),
3269
+ "\u4E08\u592B",
3270
+ "\u59BB\u5B50",
3271
+ "\u914D\u5076"
3272
+ );
3273
+ return `${spouseType}\u7684${relation}`;
3274
+ }
3275
+ spouseOf(relation) {
3276
+ if (!relation) {
3277
+ return "";
3278
+ }
3279
+ const spouse = this.path?.[this.path.length - 1].indi;
3280
+ const spouseType = pick2(sexOf3(spouse), "\u4E08\u592B", "\u59BB\u5B50", "\u914D\u5076");
3281
+ return `${relation}\u7684${spouseType}`;
3282
+ }
3283
+ of(relation) {
3284
+ const formattedName = nameFormatter(this.path?.[0]?.indi, {
3285
+ nameOrder: "last-first"
3286
+ });
3287
+ let name = formattedName.inOrder.filter(Boolean).join(" ");
3288
+ if (this.displayName === "none") {
3289
+ name = "";
3290
+ } else if (this.displayName === "givenname") {
3291
+ name = formattedName.givenname;
3292
+ } else if (this.displayName === "surname") {
3293
+ name = `${formattedName.surname}`;
3294
+ }
3295
+ if (!name || !relation) {
3296
+ return relation ?? "";
3297
+ }
3298
+ return `${name}\u7684${relation}`;
3299
+ }
3300
+ inLaw(relation) {
3301
+ let inLawRelation = relation;
3302
+ Object.keys(InLawsZh).find((pattern) => {
3303
+ const regex = new RegExp(`^${pattern}$`);
3304
+ if (relation?.match(regex)) {
3305
+ inLawRelation = InLawsZh[pattern];
3306
+ return true;
3307
+ }
3308
+ return false;
3309
+ });
3310
+ return inLawRelation ?? "";
3311
+ }
3312
+ relationType(relation) {
3313
+ if (!relation || !this.pathN?.relation) {
3314
+ return relation ?? "";
3315
+ }
3316
+ return `${this.pathN.relation}${relation}`;
3317
+ }
3318
+ };
3319
+
2879
3320
  // src/kinship-translator/kinship-translator.ts
2880
3321
  var KinshipTranslator = class {
2881
3322
  constructor(person1, person2, lang = "en", entirePath, displayName = "givenname") {
@@ -8174,7 +8615,7 @@ var ensureExtensionSchema = (gedcom, extraTags) => {
8174
8615
 
8175
8616
  // package.json
8176
8617
  var package_default = {
8177
- version: "2.1.8"};
8618
+ version: "2.1.9"};
8178
8619
 
8179
8620
  // src/utils/get-product-details.ts
8180
8621
  var getVersion = () => package_default.version;