@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,125 +0,0 @@
1
- import chalk from 'chalk';
2
- /**
3
- * Format a success message
4
- */
5
- export function formatSuccess(message) {
6
- return chalk.green(`✓ ${message}`);
7
- }
8
- /**
9
- * Format a warning message
10
- */
11
- export function formatWarning(message) {
12
- return chalk.yellow(`⚠ ${message}`);
13
- }
14
- /**
15
- * Format an error message
16
- */
17
- export function formatError(message) {
18
- return chalk.red(`✗ ${message}`);
19
- }
20
- /**
21
- * Format an info message
22
- */
23
- export function formatInfo(message) {
24
- return chalk.blue(`ℹ ${message}`);
25
- }
26
- /**
27
- * Format a header
28
- */
29
- export function formatHeader(text) {
30
- return chalk.bold.underline(text);
31
- }
32
- /**
33
- * Format a field label
34
- */
35
- export function formatLabel(label) {
36
- return chalk.cyan(`${label}:`);
37
- }
38
- /**
39
- * Format a value
40
- */
41
- export function formatValue(value) {
42
- if (value === null || value === undefined) {
43
- return chalk.gray('(none)');
44
- }
45
- return chalk.white(String(value));
46
- }
47
- /**
48
- * Format an ID
49
- */
50
- export function formatId(id) {
51
- return chalk.magenta(id);
52
- }
53
- /**
54
- * Format a count
55
- */
56
- export function formatCount(count) {
57
- return chalk.yellow(count.toLocaleString());
58
- }
59
- /**
60
- * Format a date
61
- */
62
- export function formatDate(date) {
63
- if (!date) {
64
- return chalk.gray('(unknown)');
65
- }
66
- return chalk.white(date);
67
- }
68
- /**
69
- * Format a place
70
- */
71
- export function formatPlace(place) {
72
- if (!place) {
73
- return chalk.gray('(unknown)');
74
- }
75
- return chalk.white(place);
76
- }
77
- /**
78
- * Format a name
79
- */
80
- export function formatName(name) {
81
- if (!name) {
82
- return chalk.gray('(unnamed)');
83
- }
84
- // Remove GEDCOM slashes from surname
85
- const cleanName = name.replace(/\//g, '');
86
- return chalk.white(cleanName);
87
- }
88
- /**
89
- * Format a list item
90
- */
91
- export function formatListItem(text, indent = 0) {
92
- const indentation = ' '.repeat(indent);
93
- return `${indentation}- ${text}`;
94
- }
95
- /**
96
- * Format a table row
97
- */
98
- export function formatTableRow(columns, widths) {
99
- return columns
100
- .map((col, i) => col.padEnd(widths[i]))
101
- .join(' ');
102
- }
103
- /**
104
- * Format a table separator
105
- */
106
- export function formatTableSeparator(widths) {
107
- return widths
108
- .map(width => '-'.repeat(width))
109
- .join(' ');
110
- }
111
- /**
112
- * Pretty print JSON
113
- */
114
- export function formatJson(data) {
115
- return JSON.stringify(data, null, 2);
116
- }
117
- /**
118
- * Format a progress indicator
119
- */
120
- export function formatProgress(current, total) {
121
- const percentage = Math.round((current / total) * 100);
122
- const bar = '█'.repeat(Math.floor(percentage / 5));
123
- const empty = '░'.repeat(20 - Math.floor(percentage / 5));
124
- return chalk.cyan(`[${bar}${empty}] ${percentage}%`);
125
- }
@@ -1,21 +0,0 @@
1
- /**
2
- * Read a GEDCOM file
3
- */
4
- export declare function readGedcomFile(filePath: string): string;
5
- /**
6
- * Handle CLI errors
7
- */
8
- export declare function handleError(error: unknown, context?: string): never;
9
- /**
10
- * Validate file path
11
- */
12
- export declare function validateFilePath(filePath: string | undefined, paramName: string): string;
13
- /**
14
- * Clean GEDCOM name by removing slashes
15
- */
16
- export declare function cleanGedcomName(name: string | undefined | null): string;
17
- /**
18
- * Format lifespan string
19
- */
20
- export declare function formatLifespan(birthDate: string | null | undefined, deathDate: string | null | undefined): string;
21
- //# sourceMappingURL=helpers.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../src/cli/utils/helpers.ts"],"names":[],"mappings":"AAGA;;GAEG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAWvD;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,KAAK,CAUnE;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,EAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAMxF;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,GAAG,MAAM,CAGvE;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,CAIjH"}
@@ -1,58 +0,0 @@
1
- import { readFileSync } from 'fs';
2
- import { formatError } from './formatters.js';
3
- /**
4
- * Read a GEDCOM file
5
- */
6
- export function readGedcomFile(filePath) {
7
- try {
8
- return readFileSync(filePath, 'utf-8');
9
- }
10
- catch (error) {
11
- if (error instanceof Error) {
12
- console.error(formatError(`Failed to read file: ${error.message}`));
13
- }
14
- else {
15
- console.error(formatError('Failed to read file'));
16
- }
17
- process.exit(1);
18
- }
19
- }
20
- /**
21
- * Handle CLI errors
22
- */
23
- export function handleError(error, context) {
24
- const contextMsg = context ? `${context}: ` : '';
25
- if (error instanceof Error) {
26
- console.error(formatError(`${contextMsg}${error.message}`));
27
- }
28
- else {
29
- console.error(formatError(`${contextMsg}An unknown error occurred`));
30
- }
31
- process.exit(1);
32
- }
33
- /**
34
- * Validate file path
35
- */
36
- export function validateFilePath(filePath, paramName) {
37
- if (!filePath) {
38
- console.error(formatError(`${paramName} is required`));
39
- process.exit(1);
40
- }
41
- return filePath;
42
- }
43
- /**
44
- * Clean GEDCOM name by removing slashes
45
- */
46
- export function cleanGedcomName(name) {
47
- if (!name)
48
- return '';
49
- return name.replace(/\//g, '').trim();
50
- }
51
- /**
52
- * Format lifespan string
53
- */
54
- export function formatLifespan(birthDate, deathDate) {
55
- const birth = birthDate || '?';
56
- const death = deathDate || '?';
57
- return `(${birth} - ${death})`;
58
- }
@@ -1,14 +0,0 @@
1
- /**
2
- * GEDCOM Parsing Patterns
3
- * Regular expressions for parsing GEDCOM files
4
- */
5
- export declare const REF_LINE_REG: RegExp;
6
- export declare const LINE_REG: RegExp;
7
- export declare const ID_REG: RegExp;
8
- export declare const ID_GETTER_REG: RegExp;
9
- export declare const ID_SPLIT_REG: RegExp;
10
- /**
11
- * File size limits
12
- */
13
- export declare const MAX_FILE_SIZE_TO_SYNC: number;
14
- //# sourceMappingURL=constants.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/constants/constants.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,eAAO,MAAM,YAAY,QACqE,CAAC;AAC/F,eAAO,MAAM,QAAQ,QACsF,CAAC;AAC5G,eAAO,MAAM,MAAM,QAAqB,CAAC;AACzC,eAAO,MAAM,aAAa,QAAiC,CAAC;AAC5D,eAAO,MAAM,YAAY,QAAsB,CAAC;AAEhD;;GAEG;AACH,eAAO,MAAM,qBAAqB,QAAmB,CAAC"}
@@ -1,13 +0,0 @@
1
- /**
2
- * GEDCOM Parsing Patterns
3
- * Regular expressions for parsing GEDCOM files
4
- */
5
- export const REF_LINE_REG = /^0 (?:(@[_a-zA-Z0-9]*@) )?(?<type>_[_A-Z][_a-zA-Z]{2,}|_?[A-Z][a-zA-Z]{2,}) ?(?<value>.*)/gm;
6
- export const LINE_REG = /(?<indent>^[0-9]) (?:(@[_a-zA-Z0-9]*@) )?(?<type>_[_A-Z][_a-zA-Z]{2,}|_?[A-Z][a-zA-Z]{2,}) ?(?<value>.*)/;
7
- export const ID_REG = /^@[_a-zA-Z0-9]+@/;
8
- export const ID_GETTER_REG = /^(?<at>@)?(?<letter>[A-Z])?/i;
9
- export const ID_SPLIT_REG = /^@[_a-zA-Z0-9]+@:/;
10
- /**
11
- * File size limits
12
- */
13
- export const MAX_FILE_SIZE_TO_SYNC = 1024 * 1024 * 20; // 20MB
@@ -1,18 +0,0 @@
1
- import { RelationType, PartnerType } from "../types/types";
2
- import type { RequiredFilter, Filter } from "../types/types";
3
- export declare const EVERY: Filter;
4
- export declare const FEMALE: Filter;
5
- export declare const MALE: Filter;
6
- export declare const ADOPTED: RequiredFilter<"PEDI", RelationType>;
7
- export declare const BIRTH: RequiredFilter<"PEDI", RelationType>;
8
- export declare const FOSTER: RequiredFilter<"PEDI", RelationType>;
9
- export declare const SEALING: RequiredFilter<"PEDI", RelationType>;
10
- export declare const STEP: RequiredFilter<"PEDI", RelationType>;
11
- export declare const BIOLOGICAL: RequiredFilter<"PEDI", RelationType>;
12
- export declare const FRIEND: RequiredFilter<"PART", PartnerType>;
13
- export declare const OTHER: RequiredFilter<"PART", PartnerType>;
14
- export declare const PARTNER: RequiredFilter<"PART", PartnerType>;
15
- export declare const SINGLE: RequiredFilter<"PART", PartnerType>;
16
- export declare const SPOUSE: RequiredFilter<"PART", PartnerType>;
17
- export declare const UNKOWN: RequiredFilter<"PART", PartnerType>;
18
- //# sourceMappingURL=filters.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"filters.d.ts","sourceRoot":"","sources":["../../src/constants/filters.ts"],"names":[],"mappings":"AAAA,OAAO,EAGN,YAAY,EACZ,WAAW,EACX,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAC,cAAc,EAAE,MAAM,EAAC,MAAM,gBAAgB,CAAC;AAE3D,eAAO,MAAM,KAAK,EAAE,MAAW,CAAC;AAEhC,eAAO,MAAM,MAAM,EAAE,MAEpB,CAAC;AAEF,eAAO,MAAM,IAAI,EAAE,MAElB,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,cAAc,CAAC,MAAM,EAAE,YAAY,CAExD,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,cAAc,CAAC,MAAM,EAAE,YAAY,CAEtD,CAAC;AAEF,eAAO,MAAM,MAAM,EAAE,cAAc,CAAC,MAAM,EAAE,YAAY,CAEvD,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,cAAc,CAAC,MAAM,EAAE,YAAY,CAExD,CAAC;AAEF,eAAO,MAAM,IAAI,EAAE,cAAc,CAAC,MAAM,EAAE,YAAY,CAErD,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,cAAc,CAAC,MAAM,EAAE,YAAY,CAE3D,CAAC;AAEF,eAAO,MAAM,MAAM,EAAE,cAAc,CAAC,MAAM,EAAE,WAAW,CAEtD,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,cAAc,CAAC,MAAM,EAAE,WAAW,CAErD,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,cAAc,CAAC,MAAM,EAAE,WAAW,CAEvD,CAAC;AAEF,eAAO,MAAM,MAAM,EAAE,cAAc,CAAC,MAAM,EAAE,WAAW,CAEtD,CAAC;AAEF,eAAO,MAAM,MAAM,EAAE,cAAc,CAAC,MAAM,EAAE,WAAW,CAEtD,CAAC;AAEF,eAAO,MAAM,MAAM,EAAE,cAAc,CAAC,MAAM,EAAE,WAAW,CAEtD,CAAC"}
@@ -1,44 +0,0 @@
1
- import { RelationType, PartnerType } from "../types/types.js";
2
- export const EVERY = {};
3
- export const FEMALE = {
4
- SEX: "F",
5
- };
6
- export const MALE = {
7
- SEX: "M",
8
- };
9
- export const ADOPTED = {
10
- PEDI: RelationType.ADOPTED,
11
- };
12
- export const BIRTH = {
13
- PEDI: RelationType.BIRTH,
14
- };
15
- export const FOSTER = {
16
- PEDI: RelationType.FOSTER,
17
- };
18
- export const SEALING = {
19
- PEDI: RelationType.SEALING,
20
- };
21
- export const STEP = {
22
- PEDI: RelationType.STEP,
23
- };
24
- export const BIOLOGICAL = {
25
- PEDI: RelationType.BIOLOGICAL,
26
- };
27
- export const FRIEND = {
28
- PART: PartnerType.FRIEND,
29
- };
30
- export const OTHER = {
31
- PART: PartnerType.OTHER,
32
- };
33
- export const PARTNER = {
34
- PART: PartnerType.PARTNER,
35
- };
36
- export const SINGLE = {
37
- PART: PartnerType.SINGLE,
38
- };
39
- export const SPOUSE = {
40
- PART: PartnerType.SPOUSE,
41
- };
42
- export const UNKOWN = {
43
- PART: PartnerType.UNKOWN,
44
- };
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/constants/index.ts"],"names":[],"mappings":"AACA,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,UAAU,CAAC"}
@@ -1,17 +0,0 @@
1
- import type { IndiType } from "../classes/indi";
2
- import type { OrderIterator, Order, IndiKey, NameOrder } from "../types/types";
3
- export declare const DEFAULT: Order;
4
- export declare const BIRTH_ASC: Order;
5
- export declare const BIRTH_DESC: Order;
6
- export declare const DEATH_ASC: Order;
7
- export declare const DEATH_DESC: Order;
8
- export declare const DATE_ASC: Order;
9
- export declare const DATE_DESC: Order;
10
- export declare const getNameDesc: (nameOrder?: NameOrder) => OrderIterator<IndiType, IndiKey>;
11
- export declare const getNameAsc: (nameOrder?: NameOrder) => OrderIterator<IndiType, IndiKey>;
12
- export declare const getBirthAsc: OrderIterator<IndiType, IndiKey>;
13
- export declare const getNameAscAndBirth: (nameOrder?: NameOrder) => OrderIterator<IndiType, IndiKey>;
14
- export declare const getMarriageAsc: (person?: IndiKey, famType?: "FAMS" | "FAMC") => OrderIterator<IndiType, IndiKey>;
15
- export declare const getMarriageAscAndChildBirth: (person?: IndiKey) => OrderIterator<IndiType, IndiKey>;
16
- export declare const getMarriageAscAndBirth: (person?: IndiKey) => OrderIterator<IndiType, IndiKey>;
17
- //# sourceMappingURL=orders.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"orders.d.ts","sourceRoot":"","sources":["../../src/constants/orders.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,QAAQ,EAAC,MAAM,iBAAiB,CAAC;AAE9C,OAAO,KAAK,EAAC,aAAa,EAAE,KAAK,EAAE,OAAO,EAAE,SAAS,EAAC,MAAM,gBAAgB,CAAC;AAG7E,eAAO,MAAM,OAAO,EAAE,KAAU,CAAC;AAEjC,eAAO,MAAM,SAAS,EAAE,KAUvB,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,KAUxB,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,KAUvB,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,KAUxB,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,KAUtB,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,KAUvB,CAAC;AAwGF,eAAO,MAAM,WAAW,EAAE,CACzB,SAAS,CAAC,EAAE,SAAS,KACjB,aAAa,CAAC,QAAQ,EAAE,OAAO,CAgBlC,CAAC;AAEH,eAAO,MAAM,UAAU,EAAE,CACxB,SAAS,CAAC,EAAE,SAAS,KACjB,aAAa,CAAC,QAAQ,EAAE,OAAO,CAgBlC,CAAC;AAEH,eAAO,MAAM,WAAW,EAAE,aAAa,CAAC,QAAQ,EAAE,OAAO,CAyBxD,CAAC;AAEF,eAAO,MAAM,kBAAkB,EAAE,CAChC,SAAS,CAAC,EAAE,SAAS,KACjB,aAAa,CAAC,QAAQ,EAAE,OAAO,CAUlC,CAAC;AAEH,eAAO,MAAM,cAAc,EAAE,CAC5B,MAAM,CAAC,EAAE,OAAO,EAChB,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,KACrB,aAAa,CAAC,QAAQ,EAAE,OAAO,CAsBlC,CAAC;AAEH,eAAO,MAAM,2BAA2B,EAAE,CACzC,MAAM,CAAC,EAAE,OAAO,KACZ,aAAa,CAAC,QAAQ,EAAE,OAAO,CAelC,CAAC;AAEH,eAAO,MAAM,sBAAsB,EAAE,CACpC,MAAM,CAAC,EAAE,OAAO,KACZ,aAAa,CAAC,QAAQ,EAAE,OAAO,CAclC,CAAC"}
@@ -1,240 +0,0 @@
1
- import { isCommonDate } from "../classes/date.js";
2
- import { getFamilyWith } from "../utils/get-family-with.js";
3
- export const DEFAULT = {};
4
- export const BIRTH_ASC = {
5
- "BIRT.DATE": {
6
- direction: "ASC",
7
- getter: (value, raw) => {
8
- if (isCommonDate(raw) && raw.rawValue) {
9
- return raw.rawValue.getTime();
10
- }
11
- return new Date(value).getTime();
12
- },
13
- },
14
- };
15
- export const BIRTH_DESC = {
16
- "BIRT.DATE": {
17
- direction: "DESC",
18
- getter: (value, raw) => {
19
- if (isCommonDate(raw) && raw.rawValue) {
20
- return raw.rawValue.getTime();
21
- }
22
- return new Date(value).getTime();
23
- },
24
- },
25
- };
26
- export const DEATH_ASC = {
27
- "DEAT.DATE": {
28
- direction: "ASC",
29
- getter: (value, raw) => {
30
- if (isCommonDate(raw) && raw.rawValue) {
31
- return raw.rawValue.getTime();
32
- }
33
- return new Date(value).getTime();
34
- },
35
- },
36
- };
37
- export const DEATH_DESC = {
38
- "DEAT.DATE": {
39
- direction: "DESC",
40
- getter: (value, raw) => {
41
- if (isCommonDate(raw) && raw.rawValue) {
42
- return raw.rawValue.getTime();
43
- }
44
- return new Date(value).getTime();
45
- },
46
- },
47
- };
48
- export const DATE_ASC = {
49
- DATE: {
50
- direction: "ASC",
51
- getter: (value, raw) => {
52
- if (isCommonDate(raw) && raw.rawValue) {
53
- return raw.rawValue.getTime();
54
- }
55
- return new Date(value).getTime();
56
- },
57
- },
58
- };
59
- export const DATE_DESC = {
60
- DATE: {
61
- direction: "DESC",
62
- getter: (value, raw) => {
63
- if (isCommonDate(raw) && raw.rawValue) {
64
- return raw.rawValue.getTime();
65
- }
66
- return new Date(value).getTime();
67
- },
68
- },
69
- };
70
- const chars = [
71
- "a",
72
- "à",
73
- "á",
74
- "â",
75
- "ä",
76
- "æ",
77
- "ã",
78
- "å",
79
- "ā",
80
- "b",
81
- "c",
82
- "ç",
83
- "ć",
84
- "č",
85
- "cs",
86
- "d",
87
- "dz",
88
- "dzs",
89
- "e",
90
- "è",
91
- "é",
92
- "ê",
93
- "ë",
94
- "ē",
95
- "ė",
96
- "ę",
97
- "f",
98
- "g",
99
- "gy",
100
- "h",
101
- "i",
102
- "î",
103
- "ï",
104
- "í",
105
- "ī",
106
- "į",
107
- "ì",
108
- "j",
109
- "k",
110
- "l",
111
- "ł",
112
- "ly",
113
- "m",
114
- "n",
115
- "ñ",
116
- "ń",
117
- "ny",
118
- "o",
119
- "ó",
120
- "ö",
121
- "ő",
122
- "ô",
123
- "ò",
124
- "õ",
125
- "œ",
126
- "ø",
127
- "ō",
128
- "p",
129
- "q",
130
- "r",
131
- "s",
132
- "ś",
133
- "š",
134
- "ß",
135
- "sz",
136
- "t",
137
- "ty",
138
- "u",
139
- "ú",
140
- "ü",
141
- "ű",
142
- "û",
143
- "ù",
144
- "ū",
145
- "v",
146
- "w",
147
- "x",
148
- "y",
149
- "z",
150
- "zs",
151
- ];
152
- const alphabets = chars.reduce((acc, curr, idx) => {
153
- acc[curr] = idx;
154
- return acc;
155
- }, {});
156
- const convertAlphabet = (value) => {
157
- return value
158
- .toLowerCase()
159
- .replace(/(dzs|cs|dz|gy|ly|ny|sz|ty|zs|.)/gi, (_, m) => {
160
- const code = alphabets[m];
161
- return code !== undefined
162
- ? `${`${code}`.padStart(`${chars.length}`.length, "0")}`
163
- : m;
164
- });
165
- };
166
- const sortValue = (valueA, valueB) => {
167
- return convertAlphabet(valueA).localeCompare(convertAlphabet(valueB));
168
- };
169
- export const getNameDesc = (nameOrder = "first-last") => (itemA, _keyA, itemB, _keyB) => {
170
- const valueA = nameOrder === "first-last"
171
- ? [itemA.NAME?.GIVN || "", itemA.NAME?.SURN || ""]
172
- : [itemA.NAME?.SURN || "", itemA.NAME?.GIVN || ""];
173
- const valueB = nameOrder === "first-last"
174
- ? [itemB.NAME?.GIVN || "", itemB.NAME?.SURN || ""]
175
- : [itemB.NAME?.SURN || "", itemB.NAME?.GIVN || ""];
176
- return -sortValue(valueA.filter(Boolean).join(" "), valueB.filter(Boolean).join(" "));
177
- };
178
- export const getNameAsc = (nameOrder = "first-last") => (itemA, _keyA, itemB, _keyB) => {
179
- const valueA = nameOrder === "first-last"
180
- ? [itemA.NAME?.GIVN || "", itemA.NAME?.SURN || ""]
181
- : [itemA.NAME?.SURN || "", itemA.NAME?.GIVN || ""];
182
- const valueB = nameOrder === "first-last"
183
- ? [itemB.NAME?.GIVN || "", itemB.NAME?.SURN || ""]
184
- : [itemB.NAME?.SURN || "", itemB.NAME?.GIVN || ""];
185
- return sortValue(valueA.filter(Boolean).join(" "), valueB.filter(Boolean).join(" "));
186
- };
187
- export const getBirthAsc = (itemA, _keyA, itemB, _keyB) => {
188
- const birthA = itemA?.BIRT?.toList().index(0);
189
- const birthB = itemB?.BIRT?.toList().index(0);
190
- const valueA = birthA?.DATE?.rawValue;
191
- const valueB = birthB?.DATE?.rawValue;
192
- if (valueA?.getTime() === valueB?.getTime()) {
193
- return 0;
194
- }
195
- if (!valueA || (valueB && valueA > valueB)) {
196
- return 1;
197
- }
198
- return -1;
199
- };
200
- export const getNameAscAndBirth = (nameOrder = "first-last") => (itemA, keyA, itemB, keyB) => {
201
- const nameSort = getNameAsc(nameOrder)(itemA, keyA, itemB, keyB);
202
- if (nameSort !== 0) {
203
- return nameSort;
204
- }
205
- return getBirthAsc(itemA, keyA, itemB, keyB);
206
- };
207
- export const getMarriageAsc = (person, famType = "FAMS") => (itemA, _keyA, itemB, _keyB) => {
208
- if (!person && famType === "FAMS") {
209
- return 0;
210
- }
211
- const familyA = getFamilyWith(itemA, person);
212
- const familyB = getFamilyWith(itemB, person);
213
- const marriageA = familyA?.MARR?.DATE?.rawValue;
214
- const marriageB = familyB?.MARR?.DATE?.rawValue;
215
- if (marriageA?.getTime() === marriageB?.getTime()) {
216
- return 0;
217
- }
218
- if (!marriageA || (marriageB && marriageA > marriageB)) {
219
- return 1;
220
- }
221
- return -1;
222
- };
223
- export const getMarriageAscAndChildBirth = (person) => (itemA, keyA, itemB, keyB) => {
224
- const marriageSort = getMarriageAsc(person)(itemA, keyA, itemB, keyB);
225
- if (marriageSort !== 0) {
226
- return marriageSort;
227
- }
228
- const familyA = getFamilyWith(itemA, person);
229
- const familyB = getFamilyWith(itemB, person);
230
- const childA = familyA?.getChildren().orderBy(BIRTH_ASC).index(0);
231
- const childB = familyB?.getChildren().orderBy(BIRTH_ASC).index(0);
232
- return getBirthAsc(childA, keyA, childB, keyB);
233
- };
234
- export const getMarriageAscAndBirth = (person) => (itemA, keyA, itemB, keyB) => {
235
- const marriageSort = getMarriageAsc(person, "FAMC")(itemA, keyA, itemB, keyB);
236
- if (marriageSort !== 0) {
237
- return marriageSort;
238
- }
239
- return getBirthAsc(itemA, keyA, itemB, keyB);
240
- };
@@ -1,30 +0,0 @@
1
- import type { ICacheManager } from "../utils/cache";
2
- /**
3
- * Factory function type for creating cache manager instances.
4
- * This allows the main project to inject custom cache implementations (e.g., IndexedDB).
5
- */
6
- export type CacheManagerFactory = <T>(name: string, store: string, type: string, encrypted: boolean) => ICacheManager<T>;
7
- /**
8
- * Set a custom cache manager factory.
9
- * Call this from the main project to inject IndexedDB or other cache implementations.
10
- *
11
- * @example
12
- * ```typescript
13
- * import { setCacheManagerFactory } from '@treeviz/gedcom-parser/factories/cache-factory';
14
- * import { getInstance } from './utils/indexed-db-manager';
15
- *
16
- * setCacheManagerFactory(getInstance);
17
- * ```
18
- */
19
- export declare const setCacheManagerFactory: (factory: CacheManagerFactory) => void;
20
- /**
21
- * Get the current cache manager factory.
22
- * Used internally by the cache utility.
23
- */
24
- export declare const getCacheManagerFactory: () => CacheManagerFactory;
25
- /**
26
- * Reset to default in-memory cache factory.
27
- * Useful for testing or when switching between projects.
28
- */
29
- export declare const resetCacheManagerFactory: () => void;
30
- //# sourceMappingURL=cache-factory.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cache-factory.d.ts","sourceRoot":"","sources":["../../src/factories/cache-factory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAEpD;;;GAGG;AACH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,EACnC,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,MAAM,EACZ,SAAS,EAAE,OAAO,KACd,aAAa,CAAC,CAAC,CAAC,CAAC;AAkBtB;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,sBAAsB,GAAI,SAAS,mBAAmB,SAElE,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,sBAAsB,QAAO,mBAEzC,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,wBAAwB,YAEpC,CAAC"}
@@ -1,43 +0,0 @@
1
- /**
2
- * Default in-memory cache manager factory.
3
- * This is used as a fallback when no custom factory is provided.
4
- */
5
- const defaultCacheFactory = () => {
6
- let cache = null;
7
- return {
8
- getItem: async () => cache,
9
- setItem: async (value) => {
10
- cache = value;
11
- },
12
- };
13
- };
14
- let cacheFactory = defaultCacheFactory;
15
- /**
16
- * Set a custom cache manager factory.
17
- * Call this from the main project to inject IndexedDB or other cache implementations.
18
- *
19
- * @example
20
- * ```typescript
21
- * import { setCacheManagerFactory } from '@treeviz/gedcom-parser/factories/cache-factory';
22
- * import { getInstance } from './utils/indexed-db-manager.js';
23
- *
24
- * setCacheManagerFactory(getInstance);
25
- * ```
26
- */
27
- export const setCacheManagerFactory = (factory) => {
28
- cacheFactory = factory;
29
- };
30
- /**
31
- * Get the current cache manager factory.
32
- * Used internally by the cache utility.
33
- */
34
- export const getCacheManagerFactory = () => {
35
- return cacheFactory;
36
- };
37
- /**
38
- * Reset to default in-memory cache factory.
39
- * Useful for testing or when switching between projects.
40
- */
41
- export const resetCacheManagerFactory = () => {
42
- cacheFactory = defaultCacheFactory;
43
- };
@@ -1,30 +0,0 @@
1
- import type { Locale } from "date-fns";
2
- /**
3
- * Date locale provider function type.
4
- * Returns the date-fns Locale object for the current language.
5
- */
6
- export type DateLocaleProvider = () => Locale | undefined;
7
- /**
8
- * Set a custom date locale provider.
9
- * This allows the main project or external projects to override the date locale logic.
10
- *
11
- * @example
12
- * ```typescript
13
- * import { setDateLocaleProvider } from '@treeviz/gedcom-parser/factories/date-locale-factory';
14
- * import { getDateFnsLocale } from './constants/ui-options';
15
- *
16
- * setDateLocaleProvider(getDateFnsLocale);
17
- * ```
18
- */
19
- export declare const setDateLocaleProvider: (provider: DateLocaleProvider) => void;
20
- /**
21
- * Get the current date locale.
22
- * Used internally by the Date class for formatting dates.
23
- */
24
- export declare const getDateLocale: () => Locale | undefined;
25
- /**
26
- * Reset to the default date locale provider.
27
- * Useful for testing or when switching between projects.
28
- */
29
- export declare const resetDateLocaleProvider: () => void;
30
- //# sourceMappingURL=date-locale-factory.d.ts.map