@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.
Files changed (367) hide show
  1. package/dist/classes/index.d.ts +2 -28
  2. package/dist/classes/index.js +6713 -21
  3. package/dist/classes/index.js.map +1 -0
  4. package/dist/cli/index.d.ts +0 -2
  5. package/dist/cli/index.js +7826 -24
  6. package/dist/cli/index.js.map +1 -0
  7. package/dist/constants/index.d.ts +49 -4
  8. package/dist/constants/index.js +5797 -4
  9. package/dist/constants/index.js.map +1 -0
  10. package/dist/factories/index.d.ts +202 -13
  11. package/dist/factories/index.js +5782 -8
  12. package/dist/factories/index.js.map +1 -0
  13. package/dist/index-BvW-KWJP.d.ts +1654 -0
  14. package/dist/index.d.ts +9 -28
  15. package/dist/index.js +7380 -35
  16. package/dist/index.js.map +1 -0
  17. package/dist/interfaces/index.d.ts +2 -12
  18. package/dist/interfaces/index.js +3 -1
  19. package/dist/interfaces/index.js.map +1 -0
  20. package/dist/kinship-translator/index.d.ts +146 -11
  21. package/dist/kinship-translator/index.js +5727 -9
  22. package/dist/kinship-translator/index.js.map +1 -0
  23. package/dist/place-parser-RlXCXZ8F.d.ts +37 -0
  24. package/dist/structures/index.d.ts +25 -27
  25. package/dist/structures/index.js +3 -1
  26. package/dist/structures/index.js.map +1 -0
  27. package/dist/types/index.d.ts +69 -8
  28. package/dist/types/index.js +31 -6
  29. package/dist/types/index.js.map +1 -0
  30. package/dist/utils/index.d.ts +91 -18
  31. package/dist/utils/index.js +6953 -17
  32. package/dist/utils/index.js.map +1 -0
  33. package/package.json +4 -3
  34. package/dist/classes/common.d.ts +0 -91
  35. package/dist/classes/common.d.ts.map +0 -1
  36. package/dist/classes/common.js +0 -488
  37. package/dist/classes/date.d.ts +0 -27
  38. package/dist/classes/date.d.ts.map +0 -1
  39. package/dist/classes/date.js +0 -178
  40. package/dist/classes/fam.d.ts +0 -19
  41. package/dist/classes/fam.d.ts.map +0 -1
  42. package/dist/classes/fam.js +0 -38
  43. package/dist/classes/fams.d.ts +0 -16
  44. package/dist/classes/fams.d.ts.map +0 -1
  45. package/dist/classes/fams.js +0 -41
  46. package/dist/classes/gedcom.d.ts +0 -139
  47. package/dist/classes/gedcom.d.ts.map +0 -1
  48. package/dist/classes/gedcom.js +0 -910
  49. package/dist/classes/index.d.ts.map +0 -1
  50. package/dist/classes/indi.d.ts +0 -323
  51. package/dist/classes/indi.d.ts.map +0 -1
  52. package/dist/classes/indi.js +0 -2131
  53. package/dist/classes/indis.d.ts +0 -55
  54. package/dist/classes/indis.d.ts.map +0 -1
  55. package/dist/classes/indis.js +0 -457
  56. package/dist/classes/list.d.ts +0 -55
  57. package/dist/classes/list.d.ts.map +0 -1
  58. package/dist/classes/list.js +0 -440
  59. package/dist/classes/name.d.ts +0 -20
  60. package/dist/classes/name.d.ts.map +0 -1
  61. package/dist/classes/name.js +0 -48
  62. package/dist/classes/note.d.ts +0 -12
  63. package/dist/classes/note.d.ts.map +0 -1
  64. package/dist/classes/note.js +0 -46
  65. package/dist/classes/obje.d.ts +0 -12
  66. package/dist/classes/obje.d.ts.map +0 -1
  67. package/dist/classes/obje.js +0 -81
  68. package/dist/classes/objes.d.ts +0 -8
  69. package/dist/classes/objes.d.ts.map +0 -1
  70. package/dist/classes/objes.js +0 -13
  71. package/dist/classes/repo.d.ts +0 -11
  72. package/dist/classes/repo.d.ts.map +0 -1
  73. package/dist/classes/repo.js +0 -6
  74. package/dist/classes/repos.d.ts +0 -8
  75. package/dist/classes/repos.d.ts.map +0 -1
  76. package/dist/classes/repos.js +0 -13
  77. package/dist/classes/sour.d.ts +0 -11
  78. package/dist/classes/sour.d.ts.map +0 -1
  79. package/dist/classes/sour.js +0 -6
  80. package/dist/classes/sours.d.ts +0 -8
  81. package/dist/classes/sours.d.ts.map +0 -1
  82. package/dist/classes/sours.js +0 -13
  83. package/dist/classes/subm.d.ts +0 -10
  84. package/dist/classes/subm.d.ts.map +0 -1
  85. package/dist/classes/subm.js +0 -6
  86. package/dist/classes/subms.d.ts +0 -8
  87. package/dist/classes/subms.d.ts.map +0 -1
  88. package/dist/classes/subms.js +0 -13
  89. package/dist/cli/commands/convert.d.ts +0 -3
  90. package/dist/cli/commands/convert.d.ts.map +0 -1
  91. package/dist/cli/commands/convert.js +0 -83
  92. package/dist/cli/commands/extract.d.ts +0 -3
  93. package/dist/cli/commands/extract.d.ts.map +0 -1
  94. package/dist/cli/commands/extract.js +0 -85
  95. package/dist/cli/commands/find.d.ts +0 -3
  96. package/dist/cli/commands/find.d.ts.map +0 -1
  97. package/dist/cli/commands/find.js +0 -97
  98. package/dist/cli/commands/info.d.ts +0 -3
  99. package/dist/cli/commands/info.d.ts.map +0 -1
  100. package/dist/cli/commands/info.js +0 -80
  101. package/dist/cli/commands/merge.d.ts +0 -3
  102. package/dist/cli/commands/merge.d.ts.map +0 -1
  103. package/dist/cli/commands/merge.js +0 -61
  104. package/dist/cli/commands/relatives.d.ts +0 -3
  105. package/dist/cli/commands/relatives.d.ts.map +0 -1
  106. package/dist/cli/commands/relatives.js +0 -107
  107. package/dist/cli/commands/show.d.ts +0 -3
  108. package/dist/cli/commands/show.d.ts.map +0 -1
  109. package/dist/cli/commands/show.js +0 -176
  110. package/dist/cli/commands/stats.d.ts +0 -3
  111. package/dist/cli/commands/stats.d.ts.map +0 -1
  112. package/dist/cli/commands/stats.js +0 -59
  113. package/dist/cli/commands/validate.d.ts +0 -3
  114. package/dist/cli/commands/validate.d.ts.map +0 -1
  115. package/dist/cli/commands/validate.js +0 -148
  116. package/dist/cli/index.d.ts.map +0 -1
  117. package/dist/cli/utils/formatters.d.ts +0 -69
  118. package/dist/cli/utils/formatters.d.ts.map +0 -1
  119. package/dist/cli/utils/formatters.js +0 -125
  120. package/dist/cli/utils/helpers.d.ts +0 -21
  121. package/dist/cli/utils/helpers.d.ts.map +0 -1
  122. package/dist/cli/utils/helpers.js +0 -58
  123. package/dist/constants/constants.d.ts +0 -14
  124. package/dist/constants/constants.d.ts.map +0 -1
  125. package/dist/constants/constants.js +0 -13
  126. package/dist/constants/filters.d.ts +0 -18
  127. package/dist/constants/filters.d.ts.map +0 -1
  128. package/dist/constants/filters.js +0 -44
  129. package/dist/constants/index.d.ts.map +0 -1
  130. package/dist/constants/orders.d.ts +0 -17
  131. package/dist/constants/orders.d.ts.map +0 -1
  132. package/dist/constants/orders.js +0 -240
  133. package/dist/factories/cache-factory.d.ts +0 -30
  134. package/dist/factories/cache-factory.d.ts.map +0 -1
  135. package/dist/factories/cache-factory.js +0 -43
  136. package/dist/factories/date-locale-factory.d.ts +0 -30
  137. package/dist/factories/date-locale-factory.d.ts.map +0 -1
  138. package/dist/factories/date-locale-factory.js +0 -34
  139. package/dist/factories/i18n-factory.d.ts +0 -40
  140. package/dist/factories/i18n-factory.d.ts.map +0 -1
  141. package/dist/factories/i18n-factory.js +0 -44
  142. package/dist/factories/index.d.ts.map +0 -1
  143. package/dist/factories/kinship-factory.d.ts +0 -38
  144. package/dist/factories/kinship-factory.d.ts.map +0 -1
  145. package/dist/factories/kinship-factory.js +0 -35
  146. package/dist/factories/place-parser-provider.d.ts +0 -32
  147. package/dist/factories/place-parser-provider.d.ts.map +0 -1
  148. package/dist/factories/place-parser-provider.js +0 -35
  149. package/dist/factories/place-translator-provider.d.ts +0 -32
  150. package/dist/factories/place-translator-provider.d.ts.map +0 -1
  151. package/dist/factories/place-translator-provider.js +0 -35
  152. package/dist/index.d.ts.map +0 -1
  153. package/dist/interfaces/common.d.ts +0 -43
  154. package/dist/interfaces/common.d.ts.map +0 -1
  155. package/dist/interfaces/common.js +0 -1
  156. package/dist/interfaces/fam.d.ts +0 -11
  157. package/dist/interfaces/fam.d.ts.map +0 -1
  158. package/dist/interfaces/fam.js +0 -1
  159. package/dist/interfaces/fams.d.ts +0 -9
  160. package/dist/interfaces/fams.d.ts.map +0 -1
  161. package/dist/interfaces/fams.js +0 -1
  162. package/dist/interfaces/gedcom.d.ts +0 -30
  163. package/dist/interfaces/gedcom.d.ts.map +0 -1
  164. package/dist/interfaces/gedcom.js +0 -1
  165. package/dist/interfaces/index.d.ts.map +0 -1
  166. package/dist/interfaces/indi.d.ts +0 -113
  167. package/dist/interfaces/indi.d.ts.map +0 -1
  168. package/dist/interfaces/indi.js +0 -1
  169. package/dist/interfaces/indis.d.ts +0 -31
  170. package/dist/interfaces/indis.d.ts.map +0 -1
  171. package/dist/interfaces/indis.js +0 -1
  172. package/dist/interfaces/list.d.ts +0 -52
  173. package/dist/interfaces/list.d.ts.map +0 -1
  174. package/dist/interfaces/list.js +0 -1
  175. package/dist/interfaces/obje.d.ts +0 -7
  176. package/dist/interfaces/obje.d.ts.map +0 -1
  177. package/dist/interfaces/obje.js +0 -1
  178. package/dist/interfaces/repo.d.ts +0 -7
  179. package/dist/interfaces/repo.d.ts.map +0 -1
  180. package/dist/interfaces/repo.js +0 -1
  181. package/dist/interfaces/sour.d.ts +0 -7
  182. package/dist/interfaces/sour.d.ts.map +0 -1
  183. package/dist/interfaces/sour.js +0 -1
  184. package/dist/interfaces/subm.d.ts +0 -6
  185. package/dist/interfaces/subm.d.ts.map +0 -1
  186. package/dist/interfaces/subm.js +0 -1
  187. package/dist/kinship-translator/index.d.ts.map +0 -1
  188. package/dist/kinship-translator/kinship-translator.basic.d.ts +0 -30
  189. package/dist/kinship-translator/kinship-translator.basic.d.ts.map +0 -1
  190. package/dist/kinship-translator/kinship-translator.basic.js +0 -74
  191. package/dist/kinship-translator/kinship-translator.d.ts +0 -26
  192. package/dist/kinship-translator/kinship-translator.d.ts.map +0 -1
  193. package/dist/kinship-translator/kinship-translator.de.d.ts +0 -18
  194. package/dist/kinship-translator/kinship-translator.de.d.ts.map +0 -1
  195. package/dist/kinship-translator/kinship-translator.de.js +0 -180
  196. package/dist/kinship-translator/kinship-translator.en.d.ts +0 -18
  197. package/dist/kinship-translator/kinship-translator.en.d.ts.map +0 -1
  198. package/dist/kinship-translator/kinship-translator.en.js +0 -182
  199. package/dist/kinship-translator/kinship-translator.es.d.ts +0 -18
  200. package/dist/kinship-translator/kinship-translator.es.d.ts.map +0 -1
  201. package/dist/kinship-translator/kinship-translator.es.js +0 -181
  202. package/dist/kinship-translator/kinship-translator.fr.d.ts +0 -18
  203. package/dist/kinship-translator/kinship-translator.fr.d.ts.map +0 -1
  204. package/dist/kinship-translator/kinship-translator.fr.js +0 -181
  205. package/dist/kinship-translator/kinship-translator.hu.d.ts +0 -19
  206. package/dist/kinship-translator/kinship-translator.hu.d.ts.map +0 -1
  207. package/dist/kinship-translator/kinship-translator.hu.js +0 -226
  208. package/dist/kinship-translator/kinship-translator.interface.d.ts +0 -19
  209. package/dist/kinship-translator/kinship-translator.interface.d.ts.map +0 -1
  210. package/dist/kinship-translator/kinship-translator.interface.js +0 -1
  211. package/dist/kinship-translator/kinship-translator.js +0 -103
  212. package/dist/kinship-translator/patterns.de.d.ts +0 -2
  213. package/dist/kinship-translator/patterns.de.d.ts.map +0 -1
  214. package/dist/kinship-translator/patterns.de.js +0 -14
  215. package/dist/kinship-translator/patterns.en.d.ts +0 -2
  216. package/dist/kinship-translator/patterns.en.d.ts.map +0 -1
  217. package/dist/kinship-translator/patterns.en.js +0 -14
  218. package/dist/kinship-translator/patterns.es.d.ts +0 -2
  219. package/dist/kinship-translator/patterns.es.d.ts.map +0 -1
  220. package/dist/kinship-translator/patterns.es.js +0 -14
  221. package/dist/kinship-translator/patterns.fr.d.ts +0 -2
  222. package/dist/kinship-translator/patterns.fr.d.ts.map +0 -1
  223. package/dist/kinship-translator/patterns.fr.js +0 -14
  224. package/dist/kinship-translator/patterns.hu.d.ts +0 -6
  225. package/dist/kinship-translator/patterns.hu.d.ts.map +0 -1
  226. package/dist/kinship-translator/patterns.hu.js +0 -97
  227. package/dist/kinship-translator/translators.d.ts +0 -6
  228. package/dist/kinship-translator/translators.d.ts.map +0 -1
  229. package/dist/kinship-translator/translators.js +0 -5
  230. package/dist/kinship-translator/types.d.ts +0 -9
  231. package/dist/kinship-translator/types.d.ts.map +0 -1
  232. package/dist/kinship-translator/types.js +0 -1
  233. package/dist/structures/address.d.ts +0 -14
  234. package/dist/structures/address.d.ts.map +0 -1
  235. package/dist/structures/address.js +0 -1
  236. package/dist/structures/association.d.ts +0 -13
  237. package/dist/structures/association.d.ts.map +0 -1
  238. package/dist/structures/association.js +0 -1
  239. package/dist/structures/change-date.d.ts +0 -8
  240. package/dist/structures/change-date.d.ts.map +0 -1
  241. package/dist/structures/change-date.js +0 -1
  242. package/dist/structures/creation-date.d.ts +0 -7
  243. package/dist/structures/creation-date.d.ts.map +0 -1
  244. package/dist/structures/creation-date.js +0 -1
  245. package/dist/structures/date.d.ts +0 -9
  246. package/dist/structures/date.d.ts.map +0 -1
  247. package/dist/structures/date.js +0 -1
  248. package/dist/structures/event-detail-structure.d.ts +0 -25
  249. package/dist/structures/event-detail-structure.d.ts.map +0 -1
  250. package/dist/structures/event-detail-structure.js +0 -1
  251. package/dist/structures/family.d.ts +0 -34
  252. package/dist/structures/family.d.ts.map +0 -1
  253. package/dist/structures/family.js +0 -1
  254. package/dist/structures/gedcom.d.ts +0 -59
  255. package/dist/structures/gedcom.d.ts.map +0 -1
  256. package/dist/structures/gedcom.js +0 -1
  257. package/dist/structures/index.d.ts.map +0 -1
  258. package/dist/structures/individual-event-detail-structure.d.ts +0 -9
  259. package/dist/structures/individual-event-detail-structure.d.ts.map +0 -1
  260. package/dist/structures/individual-event-detail-structure.js +0 -1
  261. package/dist/structures/individual-event-structure.d.ts +0 -83
  262. package/dist/structures/individual-event-structure.d.ts.map +0 -1
  263. package/dist/structures/individual-event-structure.js +0 -1
  264. package/dist/structures/individual.d.ts +0 -40
  265. package/dist/structures/individual.d.ts.map +0 -1
  266. package/dist/structures/individual.js +0 -1
  267. package/dist/structures/lds-ordinance-detail.d.ts +0 -17
  268. package/dist/structures/lds-ordinance-detail.d.ts.map +0 -1
  269. package/dist/structures/lds-ordinance-detail.js +0 -1
  270. package/dist/structures/lds-spouse-sealing.d.ts +0 -7
  271. package/dist/structures/lds-spouse-sealing.d.ts.map +0 -1
  272. package/dist/structures/lds-spouse-sealing.js +0 -1
  273. package/dist/structures/marriage-date.d.ts +0 -11
  274. package/dist/structures/marriage-date.d.ts.map +0 -1
  275. package/dist/structures/marriage-date.js +0 -1
  276. package/dist/structures/multimedia-link.d.ts +0 -16
  277. package/dist/structures/multimedia-link.d.ts.map +0 -1
  278. package/dist/structures/multimedia-link.js +0 -1
  279. package/dist/structures/non-event.d.ts +0 -12
  280. package/dist/structures/non-event.d.ts.map +0 -1
  281. package/dist/structures/non-event.js +0 -1
  282. package/dist/structures/note.d.ts +0 -16
  283. package/dist/structures/note.d.ts.map +0 -1
  284. package/dist/structures/note.js +0 -1
  285. package/dist/structures/personal-name-pieces.d.ts +0 -11
  286. package/dist/structures/personal-name-pieces.d.ts.map +0 -1
  287. package/dist/structures/personal-name-pieces.js +0 -1
  288. package/dist/structures/personal-name.d.ts +0 -16
  289. package/dist/structures/personal-name.d.ts.map +0 -1
  290. package/dist/structures/personal-name.js +0 -1
  291. package/dist/structures/place.d.ts +0 -20
  292. package/dist/structures/place.d.ts.map +0 -1
  293. package/dist/structures/place.js +0 -1
  294. package/dist/structures/repository.d.ts +0 -6
  295. package/dist/structures/repository.d.ts.map +0 -1
  296. package/dist/structures/repository.js +0 -1
  297. package/dist/structures/source-citation.d.ts +0 -27
  298. package/dist/structures/source-citation.d.ts.map +0 -1
  299. package/dist/structures/source-citation.js +0 -1
  300. package/dist/structures/source-repository-citation.d.ts +0 -13
  301. package/dist/structures/source-repository-citation.d.ts.map +0 -1
  302. package/dist/structures/source-repository-citation.js +0 -1
  303. package/dist/structures/source.d.ts +0 -28
  304. package/dist/structures/source.d.ts.map +0 -1
  305. package/dist/structures/source.js +0 -1
  306. package/dist/types/ancestry-media.d.ts +0 -65
  307. package/dist/types/ancestry-media.d.ts.map +0 -1
  308. package/dist/types/ancestry-media.js +0 -1
  309. package/dist/types/index.d.ts.map +0 -1
  310. package/dist/types/settings.d.ts +0 -12
  311. package/dist/types/settings.d.ts.map +0 -1
  312. package/dist/types/settings.js +0 -1
  313. package/dist/types/types.d.ts +0 -225
  314. package/dist/types/types.d.ts.map +0 -1
  315. package/dist/types/types.js +0 -26
  316. package/dist/utils/cache.d.ts +0 -22
  317. package/dist/utils/cache.d.ts.map +0 -1
  318. package/dist/utils/cache.js +0 -57
  319. package/dist/utils/common-creator.d.ts +0 -13
  320. package/dist/utils/common-creator.d.ts.map +0 -1
  321. package/dist/utils/common-creator.js +0 -72
  322. package/dist/utils/date-formatter.d.ts +0 -35
  323. package/dist/utils/date-formatter.d.ts.map +0 -1
  324. package/dist/utils/date-formatter.js +0 -207
  325. package/dist/utils/get-all-prop.d.ts +0 -4
  326. package/dist/utils/get-all-prop.d.ts.map +0 -1
  327. package/dist/utils/get-all-prop.js +0 -5
  328. package/dist/utils/get-family-with.d.ts +0 -5
  329. package/dist/utils/get-family-with.d.ts.map +0 -1
  330. package/dist/utils/get-family-with.js +0 -11
  331. package/dist/utils/get-places.d.ts +0 -21
  332. package/dist/utils/get-places.d.ts.map +0 -1
  333. package/dist/utils/get-places.js +0 -77
  334. package/dist/utils/get-product-details.d.ts +0 -4
  335. package/dist/utils/get-product-details.d.ts.map +0 -1
  336. package/dist/utils/get-product-details.js +0 -6
  337. package/dist/utils/get-raw-size.d.ts +0 -2
  338. package/dist/utils/get-raw-size.d.ts.map +0 -1
  339. package/dist/utils/get-raw-size.js +0 -3
  340. package/dist/utils/index.d.ts.map +0 -1
  341. package/dist/utils/logger.d.ts +0 -3
  342. package/dist/utils/logger.d.ts.map +0 -1
  343. package/dist/utils/logger.js +0 -11
  344. package/dist/utils/name-formatter.d.ts +0 -10
  345. package/dist/utils/name-formatter.d.ts.map +0 -1
  346. package/dist/utils/name-formatter.js +0 -45
  347. package/dist/utils/nested-group.d.ts +0 -4
  348. package/dist/utils/nested-group.d.ts.map +0 -1
  349. package/dist/utils/nested-group.js +0 -34
  350. package/dist/utils/ordinalize.d.ts +0 -3
  351. package/dist/utils/ordinalize.d.ts.map +0 -1
  352. package/dist/utils/ordinalize.js +0 -104
  353. package/dist/utils/parser.d.ts +0 -17
  354. package/dist/utils/parser.d.ts.map +0 -1
  355. package/dist/utils/parser.js +0 -321
  356. package/dist/utils/place-parser.d.ts +0 -16
  357. package/dist/utils/place-parser.d.ts.map +0 -1
  358. package/dist/utils/place-parser.js +0 -46
  359. package/dist/utils/place-translator.d.ts +0 -6
  360. package/dist/utils/place-translator.d.ts.map +0 -1
  361. package/dist/utils/place-translator.js +0 -8
  362. package/dist/utils/place-types.d.ts +0 -27
  363. package/dist/utils/place-types.d.ts.map +0 -1
  364. package/dist/utils/place-types.js +0 -14
  365. package/dist/utils/range.d.ts +0 -19
  366. package/dist/utils/range.d.ts.map +0 -1
  367. 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,4 +0,0 @@
1
- import type { IndiType } from "../classes/indi";
2
- import type { MultiTag } from "../types/types";
3
- export declare const getAllProp: <T>(indi?: IndiType, prop?: MultiTag) => T[];
4
- //# sourceMappingURL=get-all-prop.d.ts.map
@@ -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
- export const getAllProp = (indi, prop) => {
2
- return ((prop &&
3
- (indi?.get(prop)?.toList().values() ?? []).filter(Boolean)) ||
4
- []);
5
- };
@@ -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"}
@@ -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,4 +0,0 @@
1
- export declare const isDevelopment: () => boolean;
2
- export declare const getVersion: () => string;
3
- export declare const getName: () => string;
4
- //# sourceMappingURL=get-product-details.d.ts.map
@@ -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,6 +0,0 @@
1
- import PKG from "../../package.json" with { type: "json" };
2
- export const isDevelopment = () => {
3
- return !process.env.NODE_ENV || process.env.NODE_ENV === "development";
4
- };
5
- export const getVersion = () => PKG.version;
6
- export const getName = () => PKG.name;
@@ -1,2 +0,0 @@
1
- export declare const getRawSize: (raw?: string) => number;
2
- //# sourceMappingURL=get-raw-size.d.ts.map
@@ -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,3 +0,0 @@
1
- export const getRawSize = (raw) => {
2
- return `${raw || ""}`?.length ?? 0;
3
- };
@@ -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"}
@@ -1,3 +0,0 @@
1
- export declare const implemented: (type: string, ...args: any[]) => void;
2
- export declare const notImplemented: (type: string, ...args: any[]) => void;
3
- //# sourceMappingURL=logger.d.ts.map
@@ -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"}
@@ -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,3 +0,0 @@
1
- export declare const ordinalize: (n: number) => string;
2
- export declare const hungarianOrdinalize: (n: number) => string;
3
- //# sourceMappingURL=ordinalize.d.ts.map
@@ -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"}
@@ -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
- };
@@ -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"}