@stll/stdnum 2.1.1 → 2.1.2

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 (1181) hide show
  1. package/dist/_virtual/_rolldown/runtime.js +1 -0
  2. package/dist/ad/mod.d.ts +0 -2
  3. package/dist/ad/mod.js +1 -1
  4. package/dist/ad/mod.js.map +1 -1
  5. package/dist/ad/nrt.d.ts +4 -21
  6. package/dist/ad/nrt.js +9 -53
  7. package/dist/ad/nrt.js.map +1 -1
  8. package/dist/ae/eid.d.ts +3 -9
  9. package/dist/ae/eid.js +9 -65
  10. package/dist/ae/eid.js.map +1 -1
  11. package/dist/ae/mod.d.ts +0 -2
  12. package/dist/ae/mod.js +1 -1
  13. package/dist/ae/mod.js.map +1 -1
  14. package/dist/ai/mod.d.ts +0 -2
  15. package/dist/ai/mod.js +1 -1
  16. package/dist/ai/mod.js.map +1 -1
  17. package/dist/ai/tin.d.ts +4 -31
  18. package/dist/ai/tin.js +9 -51
  19. package/dist/ai/tin.js.map +1 -1
  20. package/dist/al/mod.d.ts +0 -2
  21. package/dist/al/mod.js +1 -1
  22. package/dist/al/mod.js.map +1 -1
  23. package/dist/al/nipt.d.ts +4 -18
  24. package/dist/al/nipt.js +9 -42
  25. package/dist/al/nipt.js.map +1 -1
  26. package/dist/am/mod.d.ts +0 -2
  27. package/dist/am/mod.js +1 -1
  28. package/dist/am/mod.js.map +1 -1
  29. package/dist/am/tin.d.ts +4 -21
  30. package/dist/am/tin.js +9 -36
  31. package/dist/am/tin.js.map +1 -1
  32. package/dist/ar/cbu.d.ts +3 -6
  33. package/dist/ar/cbu.js +9 -76
  34. package/dist/ar/cbu.js.map +1 -1
  35. package/dist/ar/cuit.d.ts +3 -11
  36. package/dist/ar/cuit.js +9 -103
  37. package/dist/ar/cuit.js.map +1 -1
  38. package/dist/ar/dni.d.ts +4 -16
  39. package/dist/ar/dni.js +9 -45
  40. package/dist/ar/dni.js.map +1 -1
  41. package/dist/ar/mod.d.ts +0 -2
  42. package/dist/ar/mod.js +1 -1
  43. package/dist/ar/mod.js.map +1 -1
  44. package/dist/at/businessid.d.ts +4 -15
  45. package/dist/at/businessid.js +9 -45
  46. package/dist/at/businessid.js.map +1 -1
  47. package/dist/at/mod.d.ts +0 -2
  48. package/dist/at/mod.js +1 -1
  49. package/dist/at/mod.js.map +1 -1
  50. package/dist/at/tin.d.ts +3 -6
  51. package/dist/at/tin.js +9 -56
  52. package/dist/at/tin.js.map +1 -1
  53. package/dist/at/uid.d.ts +3 -6
  54. package/dist/at/uid.js +9 -52
  55. package/dist/at/uid.js.map +1 -1
  56. package/dist/at/vnr.d.ts +3 -6
  57. package/dist/at/vnr.js +9 -82
  58. package/dist/at/vnr.js.map +1 -1
  59. package/dist/au/abn.d.ts +3 -6
  60. package/dist/au/abn.js +9 -64
  61. package/dist/au/abn.js.map +1 -1
  62. package/dist/au/acn.d.ts +3 -6
  63. package/dist/au/acn.js +9 -57
  64. package/dist/au/acn.js.map +1 -1
  65. package/dist/au/mod.d.ts +0 -2
  66. package/dist/au/mod.js +1 -1
  67. package/dist/au/mod.js.map +1 -1
  68. package/dist/au/tfn.d.ts +3 -6
  69. package/dist/au/tfn.js +9 -58
  70. package/dist/au/tfn.js.map +1 -1
  71. package/dist/az/mod.d.ts +0 -2
  72. package/dist/az/mod.js +1 -1
  73. package/dist/az/mod.js.map +1 -1
  74. package/dist/az/voen.d.ts +3 -13
  75. package/dist/az/voen.js +9 -83
  76. package/dist/az/voen.js.map +1 -1
  77. package/dist/ba/jmbg.d.ts +5 -8
  78. package/dist/ba/jmbg.js +10 -86
  79. package/dist/ba/jmbg.js.map +1 -1
  80. package/dist/ba/mod.d.ts +0 -2
  81. package/dist/ba/mod.js +1 -1
  82. package/dist/ba/mod.js.map +1 -1
  83. package/dist/bd/mod.d.ts +0 -2
  84. package/dist/bd/mod.js +1 -1
  85. package/dist/bd/mod.js.map +1 -1
  86. package/dist/bd/nid.d.ts +4 -28
  87. package/dist/bd/nid.js +9 -91
  88. package/dist/bd/nid.js.map +1 -1
  89. package/dist/be/bis.d.ts +3 -6
  90. package/dist/be/bis.js +9 -51
  91. package/dist/be/bis.js.map +1 -1
  92. package/dist/be/mod.d.ts +0 -2
  93. package/dist/be/mod.js +2 -2
  94. package/dist/be/mod.js.map +1 -1
  95. package/dist/be/nn.d.ts +4 -13
  96. package/dist/be/nn.js +10 -70
  97. package/dist/be/nn.js.map +1 -1
  98. package/dist/be/vat.d.ts +3 -6
  99. package/dist/be/vat.js +9 -58
  100. package/dist/be/vat.js.map +1 -1
  101. package/dist/bg/egn.d.ts +5 -12
  102. package/dist/bg/egn.js +10 -110
  103. package/dist/bg/egn.js.map +1 -1
  104. package/dist/bg/mod.d.ts +0 -2
  105. package/dist/bg/mod.js +1 -1
  106. package/dist/bg/mod.js.map +1 -1
  107. package/dist/bg/pnf.d.ts +3 -6
  108. package/dist/bg/pnf.js +9 -59
  109. package/dist/bg/pnf.js.map +1 -1
  110. package/dist/bg/vat.d.ts +3 -6
  111. package/dist/bg/vat.js +9 -143
  112. package/dist/bg/vat.js.map +1 -1
  113. package/dist/bh/cpr.d.ts +3 -6
  114. package/dist/bh/cpr.js +9 -44
  115. package/dist/bh/cpr.js.map +1 -1
  116. package/dist/bh/mod.d.ts +0 -2
  117. package/dist/bh/mod.js +1 -1
  118. package/dist/bh/mod.js.map +1 -1
  119. package/dist/bic.d.ts +4 -18
  120. package/dist/bic.js +9 -56
  121. package/dist/bic.js.map +1 -1
  122. package/dist/br/cnpj.d.ts +3 -13
  123. package/dist/br/cnpj.js +9 -109
  124. package/dist/br/cnpj.js.map +1 -1
  125. package/dist/br/cpf.d.ts +3 -6
  126. package/dist/br/cpf.js +9 -66
  127. package/dist/br/cpf.js.map +1 -1
  128. package/dist/br/mod.d.ts +0 -2
  129. package/dist/br/mod.js +1 -1
  130. package/dist/br/mod.js.map +1 -1
  131. package/dist/by/mod.d.ts +0 -2
  132. package/dist/by/mod.js +1 -1
  133. package/dist/by/mod.js.map +1 -1
  134. package/dist/by/unp.d.ts +3 -6
  135. package/dist/by/unp.js +9 -102
  136. package/dist/by/unp.js.map +1 -1
  137. package/dist/bz/mod.d.ts +0 -2
  138. package/dist/bz/mod.js +1 -1
  139. package/dist/bz/mod.js.map +1 -1
  140. package/dist/bz/tin.d.ts +3 -10
  141. package/dist/bz/tin.js +9 -64
  142. package/dist/bz/tin.js.map +1 -1
  143. package/dist/ca/bn.d.ts +3 -6
  144. package/dist/ca/bn.js +9 -61
  145. package/dist/ca/bn.js.map +1 -1
  146. package/dist/ca/mod.d.ts +0 -2
  147. package/dist/ca/mod.js +1 -1
  148. package/dist/ca/mod.js.map +1 -1
  149. package/dist/ca/sin.d.ts +3 -6
  150. package/dist/ca/sin.js +9 -50
  151. package/dist/ca/sin.js.map +1 -1
  152. package/dist/catalog.d.ts +9 -0
  153. package/dist/catalog.js +9 -0
  154. package/dist/catalog.js.map +1 -0
  155. package/dist/ch/mod.d.ts +1 -3
  156. package/dist/ch/mod.js +2 -2
  157. package/dist/ch/mod.js.map +1 -1
  158. package/dist/ch/ssn.d.ts +3 -6
  159. package/dist/ch/ssn.js +9 -55
  160. package/dist/ch/ssn.js.map +1 -1
  161. package/dist/ch/uid.d.ts +3 -6
  162. package/dist/ch/uid.js +9 -69
  163. package/dist/ch/uid.js.map +1 -1
  164. package/dist/ch/vat.d.ts +3 -6
  165. package/dist/ch/vat.js +9 -58
  166. package/dist/ch/vat.js.map +1 -1
  167. package/dist/cl/mod.d.ts +0 -2
  168. package/dist/cl/mod.js +1 -1
  169. package/dist/cl/mod.js.map +1 -1
  170. package/dist/cl/rut.d.ts +3 -11
  171. package/dist/cl/rut.js +9 -78
  172. package/dist/cl/rut.js.map +1 -1
  173. package/dist/cn/mod.d.ts +0 -2
  174. package/dist/cn/mod.js +1 -1
  175. package/dist/cn/mod.js.map +1 -1
  176. package/dist/cn/ric.d.ts +5 -12
  177. package/dist/cn/ric.js +10 -94
  178. package/dist/cn/ric.js.map +1 -1
  179. package/dist/cn/uscc.d.ts +3 -6
  180. package/dist/cn/uscc.js +9 -76
  181. package/dist/cn/uscc.js.map +1 -1
  182. package/dist/co/mod.d.ts +0 -2
  183. package/dist/co/mod.js +1 -1
  184. package/dist/co/mod.js.map +1 -1
  185. package/dist/co/nit.d.ts +3 -6
  186. package/dist/co/nit.js +9 -98
  187. package/dist/co/nit.js.map +1 -1
  188. package/dist/cr/cpf.d.ts +4 -31
  189. package/dist/cr/cpf.js +9 -61
  190. package/dist/cr/cpf.js.map +1 -1
  191. package/dist/cr/mod.d.ts +0 -2
  192. package/dist/cr/mod.js +1 -1
  193. package/dist/cr/mod.js.map +1 -1
  194. package/dist/creditcard.d.ts +5 -18
  195. package/dist/creditcard.js +8 -109
  196. package/dist/creditcard.js.map +1 -1
  197. package/dist/crypto/btcbase58.d.ts +5 -6
  198. package/dist/crypto/btcbase58.js +8 -73
  199. package/dist/crypto/btcbase58.js.map +1 -1
  200. package/dist/crypto/btcbech32.d.ts +7 -9
  201. package/dist/crypto/btcbech32.js +10 -142
  202. package/dist/crypto/btcbech32.js.map +1 -1
  203. package/dist/crypto/eth.d.ts +4 -5
  204. package/dist/crypto/eth.js +7 -59
  205. package/dist/crypto/eth.js.map +1 -1
  206. package/dist/crypto/mod.d.ts +4 -6
  207. package/dist/crypto/mod.js +6 -6
  208. package/dist/crypto/mod.js.map +1 -1
  209. package/dist/crypto/wallet.d.ts +3 -4
  210. package/dist/crypto/wallet.js +6 -51
  211. package/dist/crypto/wallet.js.map +1 -1
  212. package/dist/cu/mod.d.ts +0 -2
  213. package/dist/cu/mod.js +1 -1
  214. package/dist/cu/mod.js.map +1 -1
  215. package/dist/cu/ni.d.ts +5 -16
  216. package/dist/cu/ni.js +10 -81
  217. package/dist/cu/ni.js.map +1 -1
  218. package/dist/cy/mod.d.ts +0 -2
  219. package/dist/cy/mod.js +1 -1
  220. package/dist/cy/mod.js.map +1 -1
  221. package/dist/cy/vat.d.ts +3 -6
  222. package/dist/cy/vat.js +9 -77
  223. package/dist/cy/vat.js.map +1 -1
  224. package/dist/cz/dic.d.ts +3 -6
  225. package/dist/cz/dic.js +9 -87
  226. package/dist/cz/dic.js.map +1 -1
  227. package/dist/cz/ico.d.ts +3 -6
  228. package/dist/cz/ico.js +9 -58
  229. package/dist/cz/ico.js.map +1 -1
  230. package/dist/cz/mod.d.ts +0 -2
  231. package/dist/cz/mod.js +2 -2
  232. package/dist/cz/mod.js.map +1 -1
  233. package/dist/cz/rc.d.ts +5 -15
  234. package/dist/cz/rc.js +10 -113
  235. package/dist/cz/rc.js.map +1 -1
  236. package/dist/de/handelsreg.d.ts +4 -28
  237. package/dist/de/handelsreg.js +9 -66
  238. package/dist/de/handelsreg.js.map +1 -1
  239. package/dist/de/idnr.d.ts +3 -6
  240. package/dist/de/idnr.js +9 -88
  241. package/dist/de/idnr.js.map +1 -1
  242. package/dist/de/mod.d.ts +0 -2
  243. package/dist/de/mod.js +1 -1
  244. package/dist/de/mod.js.map +1 -1
  245. package/dist/de/stnr.d.ts +4 -30
  246. package/dist/de/stnr.js +9 -126
  247. package/dist/de/stnr.js.map +1 -1
  248. package/dist/de/svnr.d.ts +3 -6
  249. package/dist/de/svnr.js +9 -95
  250. package/dist/de/svnr.js.map +1 -1
  251. package/dist/de/vat.d.ts +3 -6
  252. package/dist/de/vat.js +9 -52
  253. package/dist/de/vat.js.map +1 -1
  254. package/dist/dk/cpr.d.ts +5 -12
  255. package/dist/dk/cpr.js +10 -79
  256. package/dist/dk/cpr.js.map +1 -1
  257. package/dist/dk/cvr.d.ts +3 -6
  258. package/dist/dk/cvr.js +9 -53
  259. package/dist/dk/cvr.js.map +1 -1
  260. package/dist/dk/mod.d.ts +0 -2
  261. package/dist/dk/mod.js +1 -1
  262. package/dist/dk/mod.js.map +1 -1
  263. package/dist/dk/vat.d.ts +3 -6
  264. package/dist/dk/vat.js +9 -58
  265. package/dist/dk/vat.js.map +1 -1
  266. package/dist/do/mod.d.ts +0 -2
  267. package/dist/do/mod.js +1 -1
  268. package/dist/do/mod.js.map +1 -1
  269. package/dist/do/rnc.d.ts +3 -10
  270. package/dist/do/rnc.js +9 -77
  271. package/dist/do/rnc.js.map +1 -1
  272. package/dist/ec/mod.d.ts +0 -2
  273. package/dist/ec/mod.js +1 -1
  274. package/dist/ec/mod.js.map +1 -1
  275. package/dist/ec/ruc.d.ts +3 -6
  276. package/dist/ec/ruc.js +9 -129
  277. package/dist/ec/ruc.js.map +1 -1
  278. package/dist/ee/ik.d.ts +6 -17
  279. package/dist/ee/ik.js +11 -118
  280. package/dist/ee/ik.js.map +1 -1
  281. package/dist/ee/mod.d.ts +0 -2
  282. package/dist/ee/mod.js +1 -1
  283. package/dist/ee/mod.js.map +1 -1
  284. package/dist/ee/registrikood.d.ts +3 -6
  285. package/dist/ee/registrikood.js +9 -53
  286. package/dist/ee/registrikood.js.map +1 -1
  287. package/dist/ee/vat.d.ts +3 -6
  288. package/dist/ee/vat.js +9 -57
  289. package/dist/ee/vat.js.map +1 -1
  290. package/dist/eg/mod.d.ts +0 -2
  291. package/dist/eg/mod.js +1 -1
  292. package/dist/eg/mod.js.map +1 -1
  293. package/dist/eg/tn.d.ts +4 -16
  294. package/dist/eg/tn.js +9 -69
  295. package/dist/eg/tn.js.map +1 -1
  296. package/dist/es/cif.d.ts +3 -6
  297. package/dist/es/cif.js +9 -53
  298. package/dist/es/cif.js.map +1 -1
  299. package/dist/es/dni.d.ts +4 -7
  300. package/dist/es/dni.js +9 -45
  301. package/dist/es/dni.js.map +1 -1
  302. package/dist/es/mod.d.ts +0 -2
  303. package/dist/es/mod.js +2 -2
  304. package/dist/es/mod.js.map +1 -1
  305. package/dist/es/nie.d.ts +3 -6
  306. package/dist/es/nie.js +9 -66
  307. package/dist/es/nie.js.map +1 -1
  308. package/dist/es/nss.d.ts +3 -6
  309. package/dist/es/nss.js +9 -53
  310. package/dist/es/nss.js.map +1 -1
  311. package/dist/es/vat.d.ts +4 -7
  312. package/dist/es/vat.js +10 -95
  313. package/dist/es/vat.js.map +1 -1
  314. package/dist/eu/mod.d.ts +3 -5
  315. package/dist/eu/mod.js +4 -4
  316. package/dist/eu/mod.js.map +1 -1
  317. package/dist/eu/vat.d.ts +4 -15
  318. package/dist/eu/vat.js +10 -184
  319. package/dist/eu/vat.js.map +1 -1
  320. package/dist/fi/hetu.d.ts +5 -12
  321. package/dist/fi/hetu.js +10 -110
  322. package/dist/fi/hetu.js.map +1 -1
  323. package/dist/fi/mod.d.ts +0 -2
  324. package/dist/fi/mod.js +2 -2
  325. package/dist/fi/mod.js.map +1 -1
  326. package/dist/fi/vat.d.ts +3 -6
  327. package/dist/fi/vat.js +9 -57
  328. package/dist/fi/vat.js.map +1 -1
  329. package/dist/fi/ytunnus.d.ts +3 -6
  330. package/dist/fi/ytunnus.js +9 -59
  331. package/dist/fi/ytunnus.js.map +1 -1
  332. package/dist/fr/mod.d.ts +0 -2
  333. package/dist/fr/mod.js +2 -2
  334. package/dist/fr/mod.js.map +1 -1
  335. package/dist/fr/nif.d.ts +3 -6
  336. package/dist/fr/nif.js +9 -52
  337. package/dist/fr/nif.js.map +1 -1
  338. package/dist/fr/nir.d.ts +5 -8
  339. package/dist/fr/nir.js +10 -91
  340. package/dist/fr/nir.js.map +1 -1
  341. package/dist/fr/siren.d.ts +3 -6
  342. package/dist/fr/siren.js +9 -44
  343. package/dist/fr/siren.js.map +1 -1
  344. package/dist/fr/siret.d.ts +3 -6
  345. package/dist/fr/siret.js +9 -60
  346. package/dist/fr/siret.js.map +1 -1
  347. package/dist/fr/tva.d.ts +3 -6
  348. package/dist/fr/tva.js +9 -66
  349. package/dist/fr/tva.js.map +1 -1
  350. package/dist/gb/mod.d.ts +0 -2
  351. package/dist/gb/mod.js +2 -2
  352. package/dist/gb/mod.js.map +1 -1
  353. package/dist/gb/nhs.d.ts +4 -5
  354. package/dist/gb/nhs.js +7 -47
  355. package/dist/gb/nhs.js.map +1 -1
  356. package/dist/gb/nino.d.ts +4 -17
  357. package/dist/gb/nino.js +9 -90
  358. package/dist/gb/nino.js.map +1 -1
  359. package/dist/gb/sedol.d.ts +4 -7
  360. package/dist/gb/sedol.js +10 -72
  361. package/dist/gb/sedol.js.map +1 -1
  362. package/dist/gb/utr.d.ts +3 -6
  363. package/dist/gb/utr.js +9 -57
  364. package/dist/gb/utr.js.map +1 -1
  365. package/dist/gb/vat.d.ts +3 -6
  366. package/dist/gb/vat.js +9 -89
  367. package/dist/gb/vat.js.map +1 -1
  368. package/dist/ge/mod.d.ts +0 -2
  369. package/dist/ge/mod.js +1 -1
  370. package/dist/ge/mod.js.map +1 -1
  371. package/dist/ge/pin.d.ts +4 -19
  372. package/dist/ge/pin.js +9 -36
  373. package/dist/ge/pin.js.map +1 -1
  374. package/dist/gh/mod.d.ts +0 -2
  375. package/dist/gh/mod.js +1 -1
  376. package/dist/gh/mod.js.map +1 -1
  377. package/dist/gh/tin.d.ts +3 -6
  378. package/dist/gh/tin.js +9 -62
  379. package/dist/gh/tin.js.map +1 -1
  380. package/dist/gr/amka.d.ts +3 -6
  381. package/dist/gr/amka.js +9 -59
  382. package/dist/gr/amka.js.map +1 -1
  383. package/dist/gr/mod.d.ts +0 -2
  384. package/dist/gr/mod.js +2 -2
  385. package/dist/gr/mod.js.map +1 -1
  386. package/dist/gr/vat.d.ts +3 -6
  387. package/dist/gr/vat.js +9 -53
  388. package/dist/gr/vat.js.map +1 -1
  389. package/dist/gt/mod.d.ts +0 -2
  390. package/dist/gt/mod.js +1 -1
  391. package/dist/gt/mod.js.map +1 -1
  392. package/dist/gt/nit.d.ts +3 -13
  393. package/dist/gt/nit.js +9 -86
  394. package/dist/gt/nit.js.map +1 -1
  395. package/dist/hk/hkid.d.ts +3 -7
  396. package/dist/hk/hkid.js +9 -80
  397. package/dist/hk/hkid.js.map +1 -1
  398. package/dist/hk/mod.d.ts +0 -2
  399. package/dist/hk/mod.js +1 -1
  400. package/dist/hk/mod.js.map +1 -1
  401. package/dist/hr/mod.d.ts +0 -2
  402. package/dist/hr/mod.js +1 -1
  403. package/dist/hr/mod.js.map +1 -1
  404. package/dist/hr/vat.d.ts +3 -6
  405. package/dist/hr/vat.js +9 -44
  406. package/dist/hr/vat.js.map +1 -1
  407. package/dist/hu/mod.d.ts +0 -2
  408. package/dist/hu/mod.js +1 -1
  409. package/dist/hu/mod.js.map +1 -1
  410. package/dist/hu/vat.d.ts +3 -6
  411. package/dist/hu/vat.js +9 -57
  412. package/dist/hu/vat.js.map +1 -1
  413. package/dist/iban.d.ts +3 -8
  414. package/dist/iban.js +9 -272
  415. package/dist/iban.js.map +1 -1
  416. package/dist/id/mod.d.ts +0 -2
  417. package/dist/id/mod.js +1 -1
  418. package/dist/id/mod.js.map +1 -1
  419. package/dist/id/npwp.d.ts +3 -6
  420. package/dist/id/npwp.js +9 -119
  421. package/dist/id/npwp.js.map +1 -1
  422. package/dist/ie/mod.d.ts +0 -2
  423. package/dist/ie/mod.js +2 -2
  424. package/dist/ie/mod.js.map +1 -1
  425. package/dist/ie/pps.d.ts +3 -6
  426. package/dist/ie/pps.js +9 -56
  427. package/dist/ie/pps.js.map +1 -1
  428. package/dist/ie/vat.d.ts +3 -6
  429. package/dist/ie/vat.js +9 -71
  430. package/dist/ie/vat.js.map +1 -1
  431. package/dist/il/idnr.d.ts +3 -6
  432. package/dist/il/idnr.js +9 -50
  433. package/dist/il/idnr.js.map +1 -1
  434. package/dist/il/mod.d.ts +0 -2
  435. package/dist/il/mod.js +1 -1
  436. package/dist/il/mod.js.map +1 -1
  437. package/dist/in/aadhaar.d.ts +3 -6
  438. package/dist/in/aadhaar.js +9 -47
  439. package/dist/in/aadhaar.js.map +1 -1
  440. package/dist/in/gstin.d.ts +3 -6
  441. package/dist/in/gstin.js +9 -119
  442. package/dist/in/gstin.js.map +1 -1
  443. package/dist/in/mod.d.ts +0 -2
  444. package/dist/in/mod.js +1 -1
  445. package/dist/in/mod.js.map +1 -1
  446. package/dist/in/pan.d.ts +4 -20
  447. package/dist/in/pan.js +9 -42
  448. package/dist/in/pan.js.map +1 -1
  449. package/dist/index.d.ts +9 -9
  450. package/dist/index.js +2 -2
  451. package/dist/iq/mod.d.ts +0 -2
  452. package/dist/iq/mod.js +1 -1
  453. package/dist/iq/mod.js.map +1 -1
  454. package/dist/iq/nid.d.ts +4 -22
  455. package/dist/iq/nid.js +9 -39
  456. package/dist/iq/nid.js.map +1 -1
  457. package/dist/ir/mod.d.ts +0 -2
  458. package/dist/ir/mod.js +1 -1
  459. package/dist/ir/mod.js.map +1 -1
  460. package/dist/ir/nid.d.ts +3 -10
  461. package/dist/ir/nid.js +9 -64
  462. package/dist/ir/nid.js.map +1 -1
  463. package/dist/is/kennitala.d.ts +3 -6
  464. package/dist/is/kennitala.js +9 -77
  465. package/dist/is/kennitala.js.map +1 -1
  466. package/dist/is/mod.d.ts +0 -2
  467. package/dist/is/mod.js +1 -1
  468. package/dist/is/mod.js.map +1 -1
  469. package/dist/is/vsk.d.ts +4 -14
  470. package/dist/is/vsk.js +9 -37
  471. package/dist/is/vsk.js.map +1 -1
  472. package/dist/isin.d.ts +3 -6
  473. package/dist/isin.js +9 -71
  474. package/dist/isin.js.map +1 -1
  475. package/dist/it/codicefiscale.d.ts +5 -13
  476. package/dist/it/codicefiscale.js +10 -214
  477. package/dist/it/codicefiscale.js.map +1 -1
  478. package/dist/it/iva.d.ts +3 -6
  479. package/dist/it/iva.js +9 -60
  480. package/dist/it/iva.js.map +1 -1
  481. package/dist/it/mod.d.ts +0 -2
  482. package/dist/it/mod.js +2 -2
  483. package/dist/it/mod.js.map +1 -1
  484. package/dist/jp/cn.d.ts +3 -6
  485. package/dist/jp/cn.js +9 -56
  486. package/dist/jp/cn.js.map +1 -1
  487. package/dist/jp/mod.d.ts +0 -2
  488. package/dist/jp/mod.js +1 -1
  489. package/dist/jp/mod.js.map +1 -1
  490. package/dist/jp/mynumber.d.ts +3 -6
  491. package/dist/jp/mynumber.js +9 -73
  492. package/dist/jp/mynumber.js.map +1 -1
  493. package/dist/kr/brn.d.ts +4 -16
  494. package/dist/kr/brn.js +9 -55
  495. package/dist/kr/brn.js.map +1 -1
  496. package/dist/kr/mod.d.ts +0 -2
  497. package/dist/kr/mod.js +1 -1
  498. package/dist/kr/mod.js.map +1 -1
  499. package/dist/kr/rrn.d.ts +5 -17
  500. package/dist/kr/rrn.js +10 -131
  501. package/dist/kr/rrn.js.map +1 -1
  502. package/dist/kw/civil.d.ts +5 -13
  503. package/dist/kw/civil.js +10 -98
  504. package/dist/kw/civil.js.map +1 -1
  505. package/dist/kw/mod.d.ts +0 -2
  506. package/dist/kw/mod.js +1 -1
  507. package/dist/kw/mod.js.map +1 -1
  508. package/dist/kz/iin.d.ts +5 -16
  509. package/dist/kz/iin.js +10 -132
  510. package/dist/kz/iin.js.map +1 -1
  511. package/dist/kz/mod.d.ts +0 -2
  512. package/dist/kz/mod.js +1 -1
  513. package/dist/kz/mod.js.map +1 -1
  514. package/dist/lei.d.ts +3 -6
  515. package/dist/lei.js +9 -55
  516. package/dist/lei.js.map +1 -1
  517. package/dist/li/mod.d.ts +0 -2
  518. package/dist/li/mod.js +1 -1
  519. package/dist/li/mod.js.map +1 -1
  520. package/dist/li/peid.d.ts +4 -16
  521. package/dist/li/peid.js +9 -49
  522. package/dist/li/peid.js.map +1 -1
  523. package/dist/lk/mod.d.ts +0 -2
  524. package/dist/lk/mod.js +1 -1
  525. package/dist/lk/mod.js.map +1 -1
  526. package/dist/lk/nic.d.ts +5 -12
  527. package/dist/lk/nic.js +10 -135
  528. package/dist/lk/nic.js.map +1 -1
  529. package/dist/lt/asmens.d.ts +3 -6
  530. package/dist/lt/asmens.js +9 -78
  531. package/dist/lt/asmens.js.map +1 -1
  532. package/dist/lt/mod.d.ts +0 -2
  533. package/dist/lt/mod.js +2 -2
  534. package/dist/lt/mod.js.map +1 -1
  535. package/dist/lt/vat.d.ts +3 -6
  536. package/dist/lt/vat.js +9 -60
  537. package/dist/lt/vat.js.map +1 -1
  538. package/dist/lu/mod.d.ts +0 -2
  539. package/dist/lu/mod.js +1 -1
  540. package/dist/lu/mod.js.map +1 -1
  541. package/dist/lu/vat.d.ts +3 -6
  542. package/dist/lu/vat.js +9 -46
  543. package/dist/lu/vat.js.map +1 -1
  544. package/dist/luhn.d.ts +3 -9
  545. package/dist/luhn.js +7 -47
  546. package/dist/luhn.js.map +1 -1
  547. package/dist/lv/mod.d.ts +0 -2
  548. package/dist/lv/mod.js +1 -1
  549. package/dist/lv/mod.js.map +1 -1
  550. package/dist/lv/vat.d.ts +3 -6
  551. package/dist/lv/vat.js +9 -101
  552. package/dist/lv/vat.js.map +1 -1
  553. package/dist/ma/ice.d.ts +3 -6
  554. package/dist/ma/ice.js +9 -44
  555. package/dist/ma/ice.js.map +1 -1
  556. package/dist/ma/mod.d.ts +0 -2
  557. package/dist/ma/mod.js +1 -1
  558. package/dist/ma/mod.js.map +1 -1
  559. package/dist/mc/mod.d.ts +0 -2
  560. package/dist/mc/mod.js +1 -1
  561. package/dist/mc/mod.js.map +1 -1
  562. package/dist/mc/tva.d.ts +3 -6
  563. package/dist/mc/tva.js +9 -50
  564. package/dist/mc/tva.js.map +1 -1
  565. package/dist/md/idno.d.ts +3 -5
  566. package/dist/md/idno.js +6 -58
  567. package/dist/md/idno.js.map +1 -1
  568. package/dist/md/mod.d.ts +0 -2
  569. package/dist/md/mod.js +1 -1
  570. package/dist/md/mod.js.map +1 -1
  571. package/dist/me/mod.d.ts +0 -2
  572. package/dist/me/mod.js +1 -1
  573. package/dist/me/mod.js.map +1 -1
  574. package/dist/me/pib.d.ts +3 -6
  575. package/dist/me/pib.js +9 -51
  576. package/dist/me/pib.js.map +1 -1
  577. package/dist/metadata.d.ts +3505 -0
  578. package/dist/metadata.js +4949 -0
  579. package/dist/metadata.js.map +1 -0
  580. package/dist/mk/edb.d.ts +3 -6
  581. package/dist/mk/edb.js +9 -64
  582. package/dist/mk/edb.js.map +1 -1
  583. package/dist/mk/mod.d.ts +0 -2
  584. package/dist/mk/mod.js +1 -1
  585. package/dist/mk/mod.js.map +1 -1
  586. package/dist/mt/mod.d.ts +0 -2
  587. package/dist/mt/mod.js +1 -1
  588. package/dist/mt/mod.js.map +1 -1
  589. package/dist/mt/vat.d.ts +3 -6
  590. package/dist/mt/vat.js +9 -58
  591. package/dist/mt/vat.js.map +1 -1
  592. package/dist/mu/brn.d.ts +4 -28
  593. package/dist/mu/brn.js +9 -44
  594. package/dist/mu/brn.js.map +1 -1
  595. package/dist/mu/mod.d.ts +0 -2
  596. package/dist/mu/mod.js +1 -1
  597. package/dist/mu/mod.js.map +1 -1
  598. package/dist/mx/clabe.d.ts +3 -10
  599. package/dist/mx/clabe.js +9 -70
  600. package/dist/mx/clabe.js.map +1 -1
  601. package/dist/mx/curp.d.ts +5 -16
  602. package/dist/mx/curp.js +10 -144
  603. package/dist/mx/curp.js.map +1 -1
  604. package/dist/mx/mod.d.ts +0 -2
  605. package/dist/mx/mod.js +1 -1
  606. package/dist/mx/mod.js.map +1 -1
  607. package/dist/mx/rfc.d.ts +3 -10
  608. package/dist/mx/rfc.js +9 -91
  609. package/dist/mx/rfc.js.map +1 -1
  610. package/dist/my/mod.d.ts +0 -2
  611. package/dist/my/mod.js +1 -1
  612. package/dist/my/mod.js.map +1 -1
  613. package/dist/my/nric.d.ts +5 -12
  614. package/dist/my/nric.js +10 -184
  615. package/dist/my/nric.js.map +1 -1
  616. package/dist/native-node.d.ts +14 -0
  617. package/dist/native-node.js +75 -0
  618. package/dist/native-node.js.map +1 -0
  619. package/dist/native.d.ts +79 -0
  620. package/dist/native.js +24 -0
  621. package/dist/native.js.map +1 -0
  622. package/dist/ng/mod.d.ts +0 -2
  623. package/dist/ng/mod.js +1 -1
  624. package/dist/ng/mod.js.map +1 -1
  625. package/dist/ng/nin.d.ts +4 -18
  626. package/dist/ng/nin.js +9 -40
  627. package/dist/ng/nin.js.map +1 -1
  628. package/dist/ni/mod.d.ts +0 -2
  629. package/dist/ni/mod.js +1 -1
  630. package/dist/ni/mod.js.map +1 -1
  631. package/dist/ni/ruc.d.ts +3 -15
  632. package/dist/ni/ruc.js +9 -87
  633. package/dist/ni/ruc.js.map +1 -1
  634. package/dist/nl/bsn.d.ts +3 -6
  635. package/dist/nl/bsn.js +9 -58
  636. package/dist/nl/bsn.js.map +1 -1
  637. package/dist/nl/kvk.d.ts +4 -14
  638. package/dist/nl/kvk.js +9 -35
  639. package/dist/nl/kvk.js.map +1 -1
  640. package/dist/nl/mod.d.ts +0 -2
  641. package/dist/nl/mod.js +2 -2
  642. package/dist/nl/mod.js.map +1 -1
  643. package/dist/nl/vat.d.ts +3 -6
  644. package/dist/nl/vat.js +9 -44
  645. package/dist/nl/vat.js.map +1 -1
  646. package/dist/no/fodselsnummer.d.ts +5 -13
  647. package/dist/no/fodselsnummer.js +10 -123
  648. package/dist/no/fodselsnummer.js.map +1 -1
  649. package/dist/no/mod.d.ts +2 -4
  650. package/dist/no/mod.js +3 -3
  651. package/dist/no/mod.js.map +1 -1
  652. package/dist/no/mva.d.ts +3 -6
  653. package/dist/no/mva.js +9 -43
  654. package/dist/no/mva.js.map +1 -1
  655. package/dist/no/orgnr.d.ts +3 -6
  656. package/dist/no/orgnr.js +9 -56
  657. package/dist/no/orgnr.js.map +1 -1
  658. package/dist/nz/ird.d.ts +3 -6
  659. package/dist/nz/ird.js +9 -92
  660. package/dist/nz/ird.js.map +1 -1
  661. package/dist/nz/mod.d.ts +0 -2
  662. package/dist/nz/mod.js +1 -1
  663. package/dist/nz/mod.js.map +1 -1
  664. package/dist/pa/mod.d.ts +0 -2
  665. package/dist/pa/mod.js +1 -1
  666. package/dist/pa/mod.js.map +1 -1
  667. package/dist/pa/ruc.d.ts +3 -15
  668. package/dist/pa/ruc.js +9 -181
  669. package/dist/pa/ruc.js.map +1 -1
  670. package/dist/patterns.d.ts +6 -35
  671. package/dist/patterns.js +10 -171
  672. package/dist/patterns.js.map +1 -1
  673. package/dist/pe/mod.d.ts +0 -2
  674. package/dist/pe/mod.js +1 -1
  675. package/dist/pe/mod.js.map +1 -1
  676. package/dist/pe/ruc.d.ts +3 -11
  677. package/dist/pe/ruc.js +9 -91
  678. package/dist/pe/ruc.js.map +1 -1
  679. package/dist/ph/mod.d.ts +0 -2
  680. package/dist/ph/mod.js +1 -1
  681. package/dist/ph/mod.js.map +1 -1
  682. package/dist/ph/philid.d.ts +4 -19
  683. package/dist/ph/philid.js +9 -45
  684. package/dist/ph/philid.js.map +1 -1
  685. package/dist/pk/cnic.d.ts +4 -19
  686. package/dist/pk/cnic.js +9 -54
  687. package/dist/pk/cnic.js.map +1 -1
  688. package/dist/pk/mod.d.ts +0 -2
  689. package/dist/pk/mod.js +1 -1
  690. package/dist/pk/mod.js.map +1 -1
  691. package/dist/pl/mod.d.ts +0 -2
  692. package/dist/pl/mod.js +1 -1
  693. package/dist/pl/mod.js.map +1 -1
  694. package/dist/pl/nip.d.ts +3 -10
  695. package/dist/pl/nip.js +9 -65
  696. package/dist/pl/nip.js.map +1 -1
  697. package/dist/pl/pesel.d.ts +5 -12
  698. package/dist/pl/pesel.js +10 -96
  699. package/dist/pl/pesel.js.map +1 -1
  700. package/dist/pl/regon.d.ts +3 -6
  701. package/dist/pl/regon.js +9 -72
  702. package/dist/pl/regon.js.map +1 -1
  703. package/dist/pt/cc.d.ts +3 -6
  704. package/dist/pt/cc.js +9 -67
  705. package/dist/pt/cc.js.map +1 -1
  706. package/dist/pt/mod.d.ts +0 -2
  707. package/dist/pt/mod.js +2 -2
  708. package/dist/pt/mod.js.map +1 -1
  709. package/dist/pt/vat.d.ts +3 -6
  710. package/dist/pt/vat.js +9 -61
  711. package/dist/pt/vat.js.map +1 -1
  712. package/dist/registry.d.ts +6 -0
  713. package/dist/registry.js +357 -0
  714. package/dist/registry.js.map +1 -0
  715. package/dist/ro/cnp.d.ts +5 -12
  716. package/dist/ro/cnp.js +10 -163
  717. package/dist/ro/cnp.js.map +1 -1
  718. package/dist/ro/mod.d.ts +0 -2
  719. package/dist/ro/mod.js +2 -2
  720. package/dist/ro/mod.js.map +1 -1
  721. package/dist/ro/vat.d.ts +3 -6
  722. package/dist/ro/vat.js +9 -74
  723. package/dist/ro/vat.js.map +1 -1
  724. package/dist/rs/mod.d.ts +0 -2
  725. package/dist/rs/mod.js +1 -1
  726. package/dist/rs/mod.js.map +1 -1
  727. package/dist/rs/pib.d.ts +3 -6
  728. package/dist/rs/pib.js +9 -48
  729. package/dist/rs/pib.js.map +1 -1
  730. package/dist/ru/inn.d.ts +3 -6
  731. package/dist/ru/inn.js +9 -89
  732. package/dist/ru/inn.js.map +1 -1
  733. package/dist/ru/mod.d.ts +0 -2
  734. package/dist/ru/mod.js +1 -1
  735. package/dist/ru/mod.js.map +1 -1
  736. package/dist/runtime.js +121 -0
  737. package/dist/runtime.js.map +1 -0
  738. package/dist/se/mod.d.ts +0 -2
  739. package/dist/se/mod.js +2 -2
  740. package/dist/se/mod.js.map +1 -1
  741. package/dist/se/orgnr.d.ts +3 -6
  742. package/dist/se/orgnr.js +9 -48
  743. package/dist/se/orgnr.js.map +1 -1
  744. package/dist/se/personnummer.d.ts +5 -16
  745. package/dist/se/personnummer.js +10 -111
  746. package/dist/se/personnummer.js.map +1 -1
  747. package/dist/se/vat.d.ts +3 -6
  748. package/dist/se/vat.js +9 -52
  749. package/dist/se/vat.js.map +1 -1
  750. package/dist/sg/mod.d.ts +0 -2
  751. package/dist/sg/mod.js +1 -1
  752. package/dist/sg/mod.js.map +1 -1
  753. package/dist/sg/uen.d.ts +3 -6
  754. package/dist/sg/uen.js +9 -180
  755. package/dist/sg/uen.js.map +1 -1
  756. package/dist/si/emso.d.ts +5 -12
  757. package/dist/si/emso.js +10 -102
  758. package/dist/si/emso.js.map +1 -1
  759. package/dist/si/mod.d.ts +0 -2
  760. package/dist/si/mod.js +2 -2
  761. package/dist/si/mod.js.map +1 -1
  762. package/dist/si/vat.d.ts +3 -6
  763. package/dist/si/vat.js +9 -61
  764. package/dist/si/vat.js.map +1 -1
  765. package/dist/sk/dic.d.ts +3 -6
  766. package/dist/sk/dic.js +9 -63
  767. package/dist/sk/dic.js.map +1 -1
  768. package/dist/sk/ico.d.ts +6 -5
  769. package/dist/sk/ico.js +9 -27
  770. package/dist/sk/ico.js.map +1 -1
  771. package/dist/sk/mod.d.ts +0 -2
  772. package/dist/sk/mod.js +1 -1
  773. package/dist/sk/mod.js.map +1 -1
  774. package/dist/sk/rc.d.ts +7 -5
  775. package/dist/sk/rc.js +10 -30
  776. package/dist/sk/rc.js.map +1 -1
  777. package/dist/th/mod.d.ts +0 -2
  778. package/dist/th/mod.js +1 -1
  779. package/dist/th/mod.js.map +1 -1
  780. package/dist/th/tin.d.ts +3 -6
  781. package/dist/th/tin.js +9 -49
  782. package/dist/th/tin.js.map +1 -1
  783. package/dist/tr/mod.d.ts +0 -2
  784. package/dist/tr/mod.js +1 -1
  785. package/dist/tr/mod.js.map +1 -1
  786. package/dist/tr/tckimlik.d.ts +3 -7
  787. package/dist/tr/tckimlik.js +9 -56
  788. package/dist/tr/tckimlik.js.map +1 -1
  789. package/dist/tr/vkn.d.ts +3 -7
  790. package/dist/tr/vkn.js +9 -56
  791. package/dist/tr/vkn.js.map +1 -1
  792. package/dist/tw/mod.d.ts +0 -2
  793. package/dist/tw/mod.js +1 -1
  794. package/dist/tw/mod.js.map +1 -1
  795. package/dist/tw/ubn.d.ts +3 -6
  796. package/dist/tw/ubn.js +9 -72
  797. package/dist/tw/ubn.js.map +1 -1
  798. package/dist/types.d.ts +16 -85
  799. package/dist/ua/edrpou.d.ts +3 -6
  800. package/dist/ua/edrpou.js +9 -92
  801. package/dist/ua/edrpou.js.map +1 -1
  802. package/dist/ua/mod.d.ts +0 -2
  803. package/dist/ua/mod.js +1 -1
  804. package/dist/ua/mod.js.map +1 -1
  805. package/dist/us/ein.d.ts +4 -17
  806. package/dist/us/ein.js +9 -221
  807. package/dist/us/ein.js.map +1 -1
  808. package/dist/us/itin.d.ts +4 -20
  809. package/dist/us/itin.js +9 -54
  810. package/dist/us/itin.js.map +1 -1
  811. package/dist/us/mod.d.ts +0 -2
  812. package/dist/us/mod.js +1 -1
  813. package/dist/us/mod.js.map +1 -1
  814. package/dist/us/rtn.d.ts +3 -6
  815. package/dist/us/rtn.js +9 -75
  816. package/dist/us/rtn.js.map +1 -1
  817. package/dist/us/ssn.d.ts +4 -18
  818. package/dist/us/ssn.js +9 -63
  819. package/dist/us/ssn.js.map +1 -1
  820. package/dist/uy/mod.d.ts +0 -2
  821. package/dist/uy/mod.js +1 -1
  822. package/dist/uy/mod.js.map +1 -1
  823. package/dist/uy/rut.d.ts +3 -10
  824. package/dist/uy/rut.js +9 -88
  825. package/dist/uy/rut.js.map +1 -1
  826. package/dist/ve/mod.d.ts +0 -2
  827. package/dist/ve/mod.js +1 -1
  828. package/dist/ve/mod.js.map +1 -1
  829. package/dist/ve/rif.d.ts +3 -10
  830. package/dist/ve/rif.js +9 -92
  831. package/dist/ve/rif.js.map +1 -1
  832. package/dist/vn/mod.d.ts +0 -2
  833. package/dist/vn/mod.js +1 -1
  834. package/dist/vn/mod.js.map +1 -1
  835. package/dist/vn/mst.d.ts +3 -6
  836. package/dist/vn/mst.js +9 -67
  837. package/dist/vn/mst.js.map +1 -1
  838. package/dist/za/idnr.d.ts +5 -12
  839. package/dist/za/idnr.js +10 -94
  840. package/dist/za/idnr.js.map +1 -1
  841. package/dist/za/mod.d.ts +0 -2
  842. package/dist/za/mod.js +1 -1
  843. package/dist/za/mod.js.map +1 -1
  844. package/index.cjs +3 -0
  845. package/package.json +38 -62
  846. package/registry.json +4829 -0
  847. package/registry.schema.json +94 -0
  848. package/LICENSE +0 -21
  849. package/README.md +0 -346
  850. package/dist/_checksums/keccak.d.ts +0 -5
  851. package/dist/_checksums/keccak.js +0 -118
  852. package/dist/_checksums/keccak.js.map +0 -1
  853. package/dist/_checksums/luhn.d.ts +0 -12
  854. package/dist/_checksums/luhn.js +0 -26
  855. package/dist/_checksums/luhn.js.map +0 -1
  856. package/dist/_checksums/mod1110.d.ts +0 -12
  857. package/dist/_checksums/mod1110.js +0 -25
  858. package/dist/_checksums/mod1110.js.map +0 -1
  859. package/dist/_checksums/mod112.d.ts +0 -24
  860. package/dist/_checksums/mod112.js +0 -53
  861. package/dist/_checksums/mod112.js.map +0 -1
  862. package/dist/_checksums/mod97.d.ts +0 -23
  863. package/dist/_checksums/mod97.js +0 -28
  864. package/dist/_checksums/mod97.js.map +0 -1
  865. package/dist/_checksums/sha256.d.ts +0 -5
  866. package/dist/_checksums/sha256.js +0 -164
  867. package/dist/_checksums/sha256.js.map +0 -1
  868. package/dist/_checksums/verhoeff.d.ts +0 -22
  869. package/dist/_checksums/verhoeff.js +0 -271
  870. package/dist/_checksums/verhoeff.js.map +0 -1
  871. package/dist/_checksums/weighted-sum.d.ts +0 -13
  872. package/dist/_checksums/weighted-sum.js +0 -22
  873. package/dist/_checksums/weighted-sum.js.map +0 -1
  874. package/dist/_util/arabic.d.ts +0 -19
  875. package/dist/_util/arabic.js +0 -41
  876. package/dist/_util/arabic.js.map +0 -1
  877. package/dist/_util/clean.d.ts +0 -18
  878. package/dist/_util/clean.js +0 -76
  879. package/dist/_util/clean.js.map +0 -1
  880. package/dist/_util/date.d.ts +0 -12
  881. package/dist/_util/date.js +0 -19
  882. package/dist/_util/date.js.map +0 -1
  883. package/dist/_util/generate.d.ts +0 -28
  884. package/dist/_util/generate.js +0 -43
  885. package/dist/_util/generate.js.map +0 -1
  886. package/dist/_util/result.d.ts +0 -8
  887. package/dist/_util/result.js +0 -13
  888. package/dist/_util/result.js.map +0 -1
  889. package/dist/_util/strings.d.ts +0 -21
  890. package/dist/_util/strings.js +0 -28
  891. package/dist/_util/strings.js.map +0 -1
  892. package/src/_checksums/keccak.ts +0 -145
  893. package/src/_checksums/luhn.ts +0 -24
  894. package/src/_checksums/mod1110.ts +0 -24
  895. package/src/_checksums/mod112.ts +0 -41
  896. package/src/_checksums/mod97.ts +0 -28
  897. package/src/_checksums/sha256.ts +0 -125
  898. package/src/_checksums/verhoeff.ts +0 -71
  899. package/src/_checksums/weighted-sum.ts +0 -23
  900. package/src/_util/arabic.ts +0 -48
  901. package/src/_util/clean.ts +0 -91
  902. package/src/_util/date.ts +0 -23
  903. package/src/_util/generate.ts +0 -62
  904. package/src/_util/result.ts +0 -10
  905. package/src/_util/strings.ts +0 -32
  906. package/src/ad/mod.ts +0 -1
  907. package/src/ad/nrt.ts +0 -123
  908. package/src/ae/eid.ts +0 -110
  909. package/src/ae/mod.ts +0 -1
  910. package/src/ai/mod.ts +0 -1
  911. package/src/ai/tin.ts +0 -102
  912. package/src/al/mod.ts +0 -1
  913. package/src/al/nipt.ts +0 -82
  914. package/src/am/mod.ts +0 -1
  915. package/src/am/tin.ts +0 -77
  916. package/src/ar/cbu.ts +0 -110
  917. package/src/ar/cuit.ts +0 -149
  918. package/src/ar/dni.ts +0 -83
  919. package/src/ar/mod.ts +0 -3
  920. package/src/at/businessid.ts +0 -78
  921. package/src/at/mod.ts +0 -4
  922. package/src/at/tin.ts +0 -94
  923. package/src/at/uid.ts +0 -96
  924. package/src/at/vnr.ts +0 -161
  925. package/src/au/abn.ts +0 -89
  926. package/src/au/acn.ts +0 -90
  927. package/src/au/mod.ts +0 -3
  928. package/src/au/tfn.ts +0 -89
  929. package/src/az/mod.ts +0 -1
  930. package/src/az/voen.ts +0 -131
  931. package/src/ba/jmbg.ts +0 -130
  932. package/src/ba/mod.ts +0 -1
  933. package/src/bd/mod.ts +0 -1
  934. package/src/bd/nid.ts +0 -143
  935. package/src/be/bis.ts +0 -109
  936. package/src/be/mod.ts +0 -3
  937. package/src/be/nn.ts +0 -129
  938. package/src/be/vat.ts +0 -111
  939. package/src/bg/egn.ts +0 -164
  940. package/src/bg/mod.ts +0 -3
  941. package/src/bg/pnf.ts +0 -90
  942. package/src/bg/vat.ts +0 -160
  943. package/src/bh/cpr.ts +0 -94
  944. package/src/bh/mod.ts +0 -1
  945. package/src/bic.ts +0 -105
  946. package/src/br/cnpj.ts +0 -156
  947. package/src/br/cpf.ts +0 -118
  948. package/src/br/mod.ts +0 -2
  949. package/src/by/mod.ts +0 -1
  950. package/src/by/unp.ts +0 -163
  951. package/src/bz/mod.ts +0 -1
  952. package/src/bz/tin.ts +0 -122
  953. package/src/ca/bn.ts +0 -111
  954. package/src/ca/mod.ts +0 -2
  955. package/src/ca/sin.ts +0 -95
  956. package/src/ch/mod.ts +0 -3
  957. package/src/ch/ssn.ts +0 -99
  958. package/src/ch/uid.ts +0 -112
  959. package/src/ch/vat.ts +0 -89
  960. package/src/cl/mod.ts +0 -1
  961. package/src/cl/rut.ts +0 -124
  962. package/src/cn/mod.ts +0 -2
  963. package/src/cn/ric.ts +0 -184
  964. package/src/cn/uscc.ts +0 -127
  965. package/src/co/mod.ts +0 -1
  966. package/src/co/nit.ts +0 -116
  967. package/src/cr/cpf.ts +0 -116
  968. package/src/cr/mod.ts +0 -1
  969. package/src/creditcard.ts +0 -194
  970. package/src/crypto/btcbase58.ts +0 -144
  971. package/src/crypto/btcbech32.ts +0 -210
  972. package/src/crypto/eth.ts +0 -114
  973. package/src/crypto/mod.ts +0 -4
  974. package/src/crypto/wallet.ts +0 -67
  975. package/src/cu/mod.ts +0 -1
  976. package/src/cu/ni.ts +0 -146
  977. package/src/cy/mod.ts +0 -1
  978. package/src/cy/vat.ts +0 -134
  979. package/src/cz/dic.ts +0 -140
  980. package/src/cz/ico.ts +0 -86
  981. package/src/cz/mod.ts +0 -3
  982. package/src/cz/rc.ts +0 -222
  983. package/src/de/handelsreg.ts +0 -122
  984. package/src/de/idnr.ts +0 -147
  985. package/src/de/mod.ts +0 -5
  986. package/src/de/stnr.ts +0 -222
  987. package/src/de/svnr.ts +0 -171
  988. package/src/de/vat.ts +0 -102
  989. package/src/dk/cpr.ts +0 -137
  990. package/src/dk/cvr.ts +0 -91
  991. package/src/dk/mod.ts +0 -3
  992. package/src/dk/vat.ts +0 -96
  993. package/src/do/mod.ts +0 -1
  994. package/src/do/rnc.ts +0 -130
  995. package/src/ec/mod.ts +0 -1
  996. package/src/ec/ruc.ts +0 -199
  997. package/src/ee/ik.ts +0 -167
  998. package/src/ee/mod.ts +0 -3
  999. package/src/ee/registrikood.ts +0 -86
  1000. package/src/ee/vat.ts +0 -89
  1001. package/src/eg/mod.ts +0 -1
  1002. package/src/eg/tn.ts +0 -107
  1003. package/src/es/cif.ts +0 -108
  1004. package/src/es/dni.ts +0 -94
  1005. package/src/es/mod.ts +0 -5
  1006. package/src/es/nie.ts +0 -111
  1007. package/src/es/nss.ts +0 -113
  1008. package/src/es/vat.ts +0 -186
  1009. package/src/eu/mod.ts +0 -1
  1010. package/src/eu/vat.ts +0 -220
  1011. package/src/fi/hetu.ts +0 -200
  1012. package/src/fi/mod.ts +0 -3
  1013. package/src/fi/vat.ts +0 -87
  1014. package/src/fi/ytunnus.ts +0 -87
  1015. package/src/fr/mod.ts +0 -5
  1016. package/src/fr/nif.ts +0 -97
  1017. package/src/fr/nir.ts +0 -197
  1018. package/src/fr/siren.ts +0 -83
  1019. package/src/fr/siret.ts +0 -126
  1020. package/src/fr/tva.ts +0 -150
  1021. package/src/gb/mod.ts +0 -5
  1022. package/src/gb/nhs.ts +0 -92
  1023. package/src/gb/nino.ts +0 -158
  1024. package/src/gb/sedol.ts +0 -143
  1025. package/src/gb/utr.ts +0 -85
  1026. package/src/gb/vat.ts +0 -162
  1027. package/src/ge/mod.ts +0 -1
  1028. package/src/ge/pin.ts +0 -75
  1029. package/src/gh/mod.ts +0 -1
  1030. package/src/gh/tin.ts +0 -105
  1031. package/src/gr/amka.ts +0 -108
  1032. package/src/gr/mod.ts +0 -2
  1033. package/src/gr/vat.ts +0 -100
  1034. package/src/gt/mod.ts +0 -1
  1035. package/src/gt/nit.ts +0 -123
  1036. package/src/hk/hkid.ts +0 -136
  1037. package/src/hk/mod.ts +0 -1
  1038. package/src/hr/mod.ts +0 -1
  1039. package/src/hr/vat.ts +0 -83
  1040. package/src/hu/mod.ts +0 -1
  1041. package/src/hu/vat.ts +0 -87
  1042. package/src/iban.ts +0 -344
  1043. package/src/id/mod.ts +0 -1
  1044. package/src/id/npwp.ts +0 -191
  1045. package/src/ie/mod.ts +0 -2
  1046. package/src/ie/pps.ts +0 -109
  1047. package/src/ie/vat.ts +0 -142
  1048. package/src/il/idnr.ts +0 -91
  1049. package/src/il/mod.ts +0 -1
  1050. package/src/in/aadhaar.ts +0 -100
  1051. package/src/in/gstin.ts +0 -175
  1052. package/src/in/mod.ts +0 -3
  1053. package/src/in/pan.ts +0 -97
  1054. package/src/index.ts +0 -123
  1055. package/src/iq/mod.ts +0 -1
  1056. package/src/iq/nid.ts +0 -75
  1057. package/src/ir/mod.ts +0 -1
  1058. package/src/ir/nid.ts +0 -124
  1059. package/src/is/kennitala.ts +0 -129
  1060. package/src/is/mod.ts +0 -2
  1061. package/src/is/vsk.ts +0 -67
  1062. package/src/isin.ts +0 -124
  1063. package/src/it/codicefiscale.ts +0 -332
  1064. package/src/it/iva.ts +0 -119
  1065. package/src/it/mod.ts +0 -2
  1066. package/src/jp/cn.ts +0 -95
  1067. package/src/jp/mod.ts +0 -2
  1068. package/src/jp/mynumber.ts +0 -107
  1069. package/src/kr/brn.ts +0 -105
  1070. package/src/kr/mod.ts +0 -2
  1071. package/src/kr/rrn.ts +0 -189
  1072. package/src/kw/civil.ts +0 -161
  1073. package/src/kw/mod.ts +0 -1
  1074. package/src/kz/iin.ts +0 -184
  1075. package/src/kz/mod.ts +0 -1
  1076. package/src/lei.ts +0 -102
  1077. package/src/li/mod.ts +0 -1
  1078. package/src/li/peid.ts +0 -70
  1079. package/src/lk/mod.ts +0 -1
  1080. package/src/lk/nic.ts +0 -233
  1081. package/src/lt/asmens.ts +0 -124
  1082. package/src/lt/mod.ts +0 -2
  1083. package/src/lt/vat.ts +0 -114
  1084. package/src/lu/mod.ts +0 -1
  1085. package/src/lu/vat.ts +0 -85
  1086. package/src/luhn.ts +0 -79
  1087. package/src/lv/mod.ts +0 -1
  1088. package/src/lv/vat.ts +0 -169
  1089. package/src/ma/ice.ts +0 -83
  1090. package/src/ma/mod.ts +0 -1
  1091. package/src/mc/mod.ts +0 -1
  1092. package/src/mc/tva.ts +0 -78
  1093. package/src/md/idno.ts +0 -90
  1094. package/src/md/mod.ts +0 -1
  1095. package/src/me/mod.ts +0 -1
  1096. package/src/me/pib.ts +0 -83
  1097. package/src/mk/edb.ts +0 -95
  1098. package/src/mk/mod.ts +0 -1
  1099. package/src/mt/mod.ts +0 -1
  1100. package/src/mt/vat.ts +0 -93
  1101. package/src/mu/brn.ts +0 -106
  1102. package/src/mu/mod.ts +0 -1
  1103. package/src/mx/clabe.ts +0 -115
  1104. package/src/mx/curp.ts +0 -247
  1105. package/src/mx/mod.ts +0 -3
  1106. package/src/mx/rfc.ts +0 -179
  1107. package/src/my/mod.ts +0 -1
  1108. package/src/my/nric.ts +0 -260
  1109. package/src/ng/mod.ts +0 -1
  1110. package/src/ng/nin.ts +0 -76
  1111. package/src/ni/mod.ts +0 -1
  1112. package/src/ni/ruc.ts +0 -180
  1113. package/src/nl/bsn.ts +0 -91
  1114. package/src/nl/kvk.ts +0 -63
  1115. package/src/nl/mod.ts +0 -3
  1116. package/src/nl/vat.ts +0 -95
  1117. package/src/no/fodselsnummer.ts +0 -197
  1118. package/src/no/mod.ts +0 -3
  1119. package/src/no/mva.ts +0 -77
  1120. package/src/no/orgnr.ts +0 -83
  1121. package/src/nz/ird.ts +0 -132
  1122. package/src/nz/mod.ts +0 -1
  1123. package/src/pa/mod.ts +0 -1
  1124. package/src/pa/ruc.ts +0 -387
  1125. package/src/patterns.ts +0 -390
  1126. package/src/pe/mod.ts +0 -1
  1127. package/src/pe/ruc.ts +0 -124
  1128. package/src/ph/mod.ts +0 -1
  1129. package/src/ph/philid.ts +0 -80
  1130. package/src/pk/cnic.ts +0 -109
  1131. package/src/pk/mod.ts +0 -1
  1132. package/src/pl/mod.ts +0 -3
  1133. package/src/pl/nip.ts +0 -100
  1134. package/src/pl/pesel.ts +0 -155
  1135. package/src/pl/regon.ts +0 -102
  1136. package/src/pt/cc.ts +0 -112
  1137. package/src/pt/mod.ts +0 -2
  1138. package/src/pt/vat.ts +0 -98
  1139. package/src/ro/cnp.ts +0 -179
  1140. package/src/ro/mod.ts +0 -2
  1141. package/src/ro/vat.ts +0 -99
  1142. package/src/rs/mod.ts +0 -1
  1143. package/src/rs/pib.ts +0 -87
  1144. package/src/ru/inn.ts +0 -113
  1145. package/src/ru/mod.ts +0 -1
  1146. package/src/se/mod.ts +0 -3
  1147. package/src/se/orgnr.ts +0 -85
  1148. package/src/se/personnummer.ts +0 -183
  1149. package/src/se/vat.ts +0 -97
  1150. package/src/sg/mod.ts +0 -1
  1151. package/src/sg/uen.ts +0 -288
  1152. package/src/si/emso.ts +0 -178
  1153. package/src/si/mod.ts +0 -2
  1154. package/src/si/vat.ts +0 -113
  1155. package/src/sk/dic.ts +0 -110
  1156. package/src/sk/ico.ts +0 -40
  1157. package/src/sk/mod.ts +0 -3
  1158. package/src/sk/rc.ts +0 -44
  1159. package/src/th/mod.ts +0 -1
  1160. package/src/th/tin.ts +0 -106
  1161. package/src/tr/mod.ts +0 -2
  1162. package/src/tr/tckimlik.ts +0 -115
  1163. package/src/tr/vkn.ts +0 -101
  1164. package/src/tw/mod.ts +0 -1
  1165. package/src/tw/ubn.ts +0 -112
  1166. package/src/types.ts +0 -262
  1167. package/src/ua/edrpou.ts +0 -108
  1168. package/src/ua/mod.ts +0 -1
  1169. package/src/us/ein.ts +0 -261
  1170. package/src/us/itin.ts +0 -129
  1171. package/src/us/mod.ts +0 -4
  1172. package/src/us/rtn.ts +0 -139
  1173. package/src/us/ssn.ts +0 -121
  1174. package/src/uy/mod.ts +0 -1
  1175. package/src/uy/rut.ts +0 -150
  1176. package/src/ve/mod.ts +0 -1
  1177. package/src/ve/rif.ts +0 -147
  1178. package/src/vn/mod.ts +0 -1
  1179. package/src/vn/mst.ts +0 -132
  1180. package/src/za/idnr.ts +0 -159
  1181. package/src/za/mod.ts +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"ird.js","names":[],"sources":["../../src/nz/ird.ts"],"sourcesContent":["/**\n * IRD number (New Zealand Inland Revenue Department\n * number, Te Tari Take).\n *\n * 8 or 9 digit number with a weighted checksum.\n * Uses primary weights, falling back to secondary\n * weights if the primary check yields 10.\n *\n * @see https://www.ird.govt.nz/\n */\n\nimport type {\n ValidateResult,\n CountryValidator,\n} from \"../types\";\n\nimport { clean } from \"#util/clean\";\nimport { randomDigits } from \"#util/generate\";\nimport { err } from \"#util/result\";\nimport { isdigits } from \"#util/strings\";\n\nconst PRIMARY_WEIGHTS = [3, 2, 7, 6, 5, 4, 3, 2] as const;\n\nconst SECONDARY_WEIGHTS = [7, 4, 3, 2, 5, 2, 7, 6] as const;\n\n/**\n * Calculate the check digit for an IRD number.\n * The input should be the number without the check\n * digit, zero-padded to 8 digits.\n */\nconst calcCheckDigit = (payload: string): number | null => {\n const padded = payload.padStart(8, \"0\");\n let sum = 0;\n for (const [i, weight] of PRIMARY_WEIGHTS.entries()) {\n sum += weight * Number(padded[i]);\n }\n let remainder = ((-sum % 11) + 11) % 11;\n if (remainder !== 10) return remainder;\n\n sum = 0;\n for (const [i, weight] of SECONDARY_WEIGHTS.entries()) {\n sum += weight * Number(padded[i]);\n }\n remainder = ((-sum % 11) + 11) % 11;\n if (remainder === 10) return null;\n return remainder;\n};\n\nconst compact = (value: string): string => {\n let v = clean(value, \" -\").toUpperCase();\n if (v.startsWith(\"NZ\")) {\n v = v.slice(2);\n }\n return v;\n};\n\nconst validate = (value: string): ValidateResult => {\n const v = compact(value);\n if (v.length !== 8 && v.length !== 9) {\n return err(\n \"INVALID_LENGTH\",\n \"IRD number must be 8 or 9 digits\",\n );\n }\n if (!isdigits(v)) {\n return err(\n \"INVALID_FORMAT\",\n \"IRD number must contain only digits\",\n );\n }\n const num = Number(v);\n if (num < 10_000_000 || num >= 150_000_000) {\n return err(\n \"INVALID_COMPONENT\",\n \"IRD number out of valid range\",\n );\n }\n const payload = v.slice(0, -1);\n const expected = calcCheckDigit(payload);\n if (expected === null) {\n return err(\n \"INVALID_COMPONENT\",\n \"IRD number cannot have a valid check digit\",\n );\n }\n if (expected !== Number(v.at(-1))) {\n return err(\n \"INVALID_CHECKSUM\",\n \"IRD check digit does not match\",\n );\n }\n return { valid: true, compact: v };\n};\n\nconst format = (value: string): string => {\n const v = compact(value);\n const last6 = v.slice(-6);\n const prefix = v.slice(0, -6);\n return `${prefix}-${last6.slice(0, 3)}-${last6.slice(3)}`;\n};\n\n/** Generate a random valid NZ IRD number. */\nconst generate = (): string => {\n for (;;) {\n const c = randomDigits(9);\n if (validate(c).valid) return c;\n }\n};\n\n/** New Zealand IRD Number. */\nconst ird: CountryValidator<\"NZ\"> = {\n name: \"IRD Number\",\n localName: \"IRD Number\",\n abbreviation: \"IRD\",\n aliases: [\"IRD number\", \"tax number NZ\"] as const,\n candidatePattern: \"\\\\d{8,9}\",\n scope: \"country\",\n country: \"NZ\",\n entityType: \"any\",\n compact,\n format,\n validate,\n description:\n \"New Zealand Inland Revenue Department number\",\n sourceUrl: \"https://www.ird.govt.nz/\",\n lengths: [8, 9] as const,\n examples: [\"49091850\", \"136410132\"] as const,\n generate,\n};\n\nexport default ird;\nexport { compact, format, validate, generate };\n"],"mappings":";;;;;AAqBA,MAAM,kBAAkB;CAAC;CAAG;CAAG;CAAG;CAAG;CAAG;CAAG;CAAG;AAAC;AAE/C,MAAM,oBAAoB;CAAC;CAAG;CAAG;CAAG;CAAG;CAAG;CAAG;CAAG;AAAC;;;;;;AAOjD,MAAM,kBAAkB,YAAmC;CACzD,MAAM,SAAS,QAAQ,SAAS,GAAG,GAAG;CACtC,IAAI,MAAM;CACV,KAAK,MAAM,CAAC,GAAG,WAAW,gBAAgB,QAAQ,GAChD,OAAO,SAAS,OAAO,OAAO,EAAE;CAElC,IAAI,aAAc,CAAC,MAAM,KAAM,MAAM;CACrC,IAAI,cAAc,IAAI,OAAO;CAE7B,MAAM;CACN,KAAK,MAAM,CAAC,GAAG,WAAW,kBAAkB,QAAQ,GAClD,OAAO,SAAS,OAAO,OAAO,EAAE;CAElC,aAAc,CAAC,MAAM,KAAM,MAAM;CACjC,IAAI,cAAc,IAAI,OAAO;CAC7B,OAAO;AACT;AAEA,MAAM,WAAW,UAA0B;CACzC,IAAI,IAAI,MAAM,OAAO,IAAI,CAAC,CAAC,YAAY;CACvC,IAAI,EAAE,WAAW,IAAI,GACnB,IAAI,EAAE,MAAM,CAAC;CAEf,OAAO;AACT;AAEA,MAAM,YAAY,UAAkC;CAClD,MAAM,IAAI,QAAQ,KAAK;CACvB,IAAI,EAAE,WAAW,KAAK,EAAE,WAAW,GACjC,OAAO,IACL,kBACA,kCACF;CAEF,IAAI,CAAC,SAAS,CAAC,GACb,OAAO,IACL,kBACA,qCACF;CAEF,MAAM,MAAM,OAAO,CAAC;CACpB,IAAI,MAAM,OAAc,OAAO,MAC7B,OAAO,IACL,qBACA,+BACF;CAGF,MAAM,WAAW,eADD,EAAE,MAAM,GAAG,EACW,CAAC;CACvC,IAAI,aAAa,MACf,OAAO,IACL,qBACA,4CACF;CAEF,IAAI,aAAa,OAAO,EAAE,GAAG,EAAE,CAAC,GAC9B,OAAO,IACL,oBACA,gCACF;CAEF,OAAO;EAAE,OAAO;EAAM,SAAS;CAAE;AACnC;AAEA,MAAM,UAAU,UAA0B;CACxC,MAAM,IAAI,QAAQ,KAAK;CACvB,MAAM,QAAQ,EAAE,MAAM,EAAE;CAExB,OAAO,GADQ,EAAE,MAAM,GAAG,EACX,EAAE,GAAG,MAAM,MAAM,GAAG,CAAC,EAAE,GAAG,MAAM,MAAM,CAAC;AACxD;;AAGA,MAAM,iBAAyB;CAC7B,SAAS;EACP,MAAM,IAAI,aAAa,CAAC;EACxB,IAAI,SAAS,CAAC,CAAC,CAAC,OAAO,OAAO;CAChC;AACF;;AAGA,MAAM,MAA8B;CAClC,MAAM;CACN,WAAW;CACX,cAAc;CACd,SAAS,CAAC,cAAc,eAAe;CACvC,kBAAkB;CAClB,OAAO;CACP,SAAS;CACT,YAAY;CACZ;CACA;CACA;CACA,aACE;CACF,WAAW;CACX,SAAS,CAAC,GAAG,CAAC;CACd,UAAU,CAAC,YAAY,WAAW;CAClC;AACF"}
1
+ {"version":3,"file":"ird.js","names":[],"sources":["../../src/generated/nz/ird.ts"],"sourcesContent":["// Generated by scripts/generate-public-surface.ts. Do not edit.\nimport { createValidator } from \"../../runtime\";\nimport type { CountryValidator } from \"../../types\";\n\nconst ird: CountryValidator<\"NZ\"> = createValidator(\n \"nz.ird\",\n 139,\n);\n\nexport default ird;\nexport const compact = ird.compact;\nexport const format = ird.format;\nexport const validate = ird.validate;\nexport const generate = (): string =>\n ird.generate?.() ??\n (() => {\n throw new Error(\n \"Validator nz.ird cannot generate values\",\n );\n })();\n"],"mappings":";;AAIA,MAAM,MAA8B,gBAClC,UACA,GACF;AAGA,MAAa,UAAU,IAAI;AAC3B,MAAa,SAAS,IAAI;AAC1B,MAAa,WAAW,IAAI;AAC5B,MAAa,iBACX,IAAI,WAAW,YACR;CACL,MAAM,IAAI,MACR,yCACF;AACF,EAAA,CAAG"}
package/dist/nz/mod.d.ts CHANGED
@@ -1,6 +1,4 @@
1
1
  import ird from "./ird.js";
2
-
3
- //#region src/nz/mod.d.ts
4
2
  declare namespace mod_d_exports {
5
3
  export { ird };
6
4
  }
package/dist/nz/mod.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { __exportAll } from "../_virtual/_rolldown/runtime.js";
2
2
  import ird from "./ird.js";
3
- //#region src/nz/mod.ts
3
+ //#region src/generated/nz/mod.ts
4
4
  var nz_exports = /* @__PURE__ */ __exportAll({ ird: () => ird });
5
5
  //#endregion
6
6
  export { ird, nz_exports };
@@ -1 +1 @@
1
- {"version":3,"file":"mod.js","names":[],"sources":["../../src/nz/mod.ts"],"sourcesContent":["export { default as ird } from \"./ird\";\n"],"mappings":""}
1
+ {"version":3,"file":"mod.js","names":[],"sources":["../../src/generated/nz/mod.ts"],"sourcesContent":["// Generated by scripts/generate-public-surface.ts. Do not edit.\nexport { default as ird } from \"./ird\";\n"],"mappings":""}
package/dist/pa/mod.d.ts CHANGED
@@ -1,6 +1,4 @@
1
1
  import ruc from "./ruc.js";
2
-
3
- //#region src/pa/mod.d.ts
4
2
  declare namespace mod_d_exports {
5
3
  export { ruc };
6
4
  }
package/dist/pa/mod.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { __exportAll } from "../_virtual/_rolldown/runtime.js";
2
2
  import ruc from "./ruc.js";
3
- //#region src/pa/mod.ts
3
+ //#region src/generated/pa/mod.ts
4
4
  var pa_exports = /* @__PURE__ */ __exportAll({ ruc: () => ruc });
5
5
  //#endregion
6
6
  export { pa_exports, ruc };
@@ -1 +1 @@
1
- {"version":3,"file":"mod.js","names":[],"sources":["../../src/pa/mod.ts"],"sourcesContent":["export { default as ruc } from \"./ruc\";\n"],"mappings":""}
1
+ {"version":3,"file":"mod.js","names":[],"sources":["../../src/generated/pa/mod.ts"],"sourcesContent":["// Generated by scripts/generate-public-surface.ts. Do not edit.\nexport { default as ruc } from \"./ruc\";\n"],"mappings":""}
package/dist/pa/ruc.d.ts CHANGED
@@ -1,22 +1,10 @@
1
1
  import { CountryValidator, ValidateResult } from "../types.js";
2
-
3
- //#region src/pa/ruc.d.ts
4
- /**
5
- * Compact: normalize Unicode, collapse whitespace,
6
- * strip colons around DV, and uppercase. Keeps
7
- * hyphens (structural separators) and a single
8
- * space before "DV".
9
- */
2
+ //#region src/generated/pa/ruc.d.ts
3
+ declare const ruc: CountryValidator<"PA">;
10
4
  declare const compact: (value: string) => string;
11
- declare const validate: (value: string) => ValidateResult;
12
- /**
13
- * Format: display as segments with " DV XX".
14
- */
15
5
  declare const format: (value: string) => string;
16
- /** Generate a random valid Panama RUC (natural person). */
6
+ declare const validate: (value: string) => ValidateResult;
17
7
  declare const generate: () => string;
18
- /** Panama tax identification number. */
19
- declare const ruc: CountryValidator<"PA">;
20
8
  //#endregion
21
9
  export { compact, ruc as default, format, generate, validate };
22
10
  //# sourceMappingURL=ruc.d.ts.map
package/dist/pa/ruc.js CHANGED
@@ -1,184 +1,12 @@
1
- import { clean } from "../_util/clean.js";
2
- import { randomInt } from "../_util/generate.js";
3
- import { err } from "../_util/result.js";
4
- //#region src/pa/ruc.ts
5
- /**
6
- * Legacy cross-reference table: maps two-digit codes
7
- * at positions 5–6 of old-format juridical RUCs.
8
- */
9
- const LEGACY_MAP = {
10
- "00": "00",
11
- "10": "01",
12
- "11": "02",
13
- "12": "03",
14
- "13": "04",
15
- "14": "05",
16
- "15": "06",
17
- "16": "07",
18
- "17": "08",
19
- "18": "09",
20
- "19": "01",
21
- "20": "02",
22
- "21": "03",
23
- "22": "04",
24
- "23": "07",
25
- "24": "08",
26
- "25": "09",
27
- "26": "02",
28
- "27": "03",
29
- "28": "04",
30
- "29": "05",
31
- "30": "06",
32
- "31": "07",
33
- "32": "08",
34
- "33": "09",
35
- "34": "01",
36
- "35": "02",
37
- "36": "03",
38
- "37": "04",
39
- "38": "05",
40
- "39": "06",
41
- "40": "07",
42
- "41": "08",
43
- "42": "09",
44
- "43": "01",
45
- "44": "02",
46
- "45": "03",
47
- "46": "04",
48
- "47": "05",
49
- "48": "06",
50
- "49": "07"
51
- };
52
- /** Prepend n leading zeros. */
53
- const z = (n) => "0".repeat(Math.max(0, n));
54
- /**
55
- * Compute a single DV digit via weighted sum mod 11.
56
- * Weights start at 2 and increment, applied
57
- * right-to-left. For old-format juridical RUCs,
58
- * weight 12 is skipped (jumps from 11 to 13).
59
- */
60
- const digitDV = (buf, isOldFormat) => {
61
- let weight = 2;
62
- let sum = 0;
63
- for (let i = buf.length - 1; i >= 0; i--) {
64
- if (isOldFormat && weight === 12) weight += 1;
65
- sum += weight * (buf.charCodeAt(i) - 48);
66
- weight += 1;
67
- }
68
- const r = sum % 11;
69
- return r > 1 ? 11 - r : 0;
70
- };
71
- /**
72
- * Encode the RUC segments into a numeric buffer
73
- * according to entity type, then compute the two
74
- * DV digits.
75
- *
76
- * Returns the two-digit DV string, or null if the
77
- * format is unrecognized.
78
- */
79
- const computeDV = (segments, raw) => {
80
- const len = segments.length;
81
- if (len < 3 || len > 4) return null;
82
- if (len === 4 !== (segments[1] === "NT")) return null;
83
- let buf;
84
- let isOld = false;
85
- const s0 = segments[0];
86
- const s1 = segments[1];
87
- const s2 = segments[2];
88
- if (raw[0] === "E") buf = z(4 - s1.length) + "00000050050" + z(3 - s1.length) + s1 + z(5 - s2.length) + s2;
89
- else if (s1 === "NT") {
90
- const s3 = segments[3];
91
- const prefix = s0.slice(0, -2);
92
- buf = z(4 - s1.length) + "0000005" + z(4 - prefix.length) + prefix + "43" + z(3 - s2.length) + s2 + z(5 - s3.length) + s3;
93
- } else if (s0.endsWith("AV")) {
94
- const prefix = s0.slice(0, -2);
95
- buf = z(4 - s1.length) + "0000005" + z(4 - prefix.length) + prefix + "15" + z(3 - s1.length) + s1 + z(5 - s2.length) + s2;
96
- } else if (s0.endsWith("PI")) {
97
- const prefix = s0.slice(0, -2);
98
- buf = z(4 - s1.length) + "0000005" + z(4 - prefix.length) + prefix + "79" + z(3 - s1.length) + s1 + z(5 - s2.length) + s2;
99
- } else if (s0 === "PE") buf = z(4 - s1.length) + "00000050075" + z(3 - s1.length) + s1 + z(5 - s2.length) + s2;
100
- else if (raw[0] === "N") buf = z(4 - s1.length) + "00000050040" + z(3 - s1.length) + s1 + z(5 - s2.length) + s2;
101
- else if (s0.length >= 1 && s0.length <= 2) buf = z(4 - s1.length) + "0000005" + z(2 - s0.length) + s0 + "00" + z(3 - s1.length) + s1 + z(5 - s2.length) + s2;
102
- else {
103
- buf = z(10 - s0.length) + s0 + z(4 - s1.length) + s1 + z(6 - s2.length) + s2;
104
- isOld = buf[3] === "0" && buf[4] === "0" && buf[5] < "5";
105
- }
106
- if (isOld) {
107
- const key = buf.slice(5, 7);
108
- const mapped = LEGACY_MAP[key] ?? key;
109
- buf = buf.slice(0, 5) + mapped + buf.slice(7);
110
- }
111
- const dv1 = digitDV(buf, isOld);
112
- return `${dv1}${digitDV(buf + String.fromCharCode(48 + dv1), isOld)}`;
113
- };
114
- /**
115
- * Compact: normalize Unicode, collapse whitespace,
116
- * strip colons around DV, and uppercase. Keeps
117
- * hyphens (structural separators) and a single
118
- * space before "DV".
119
- */
120
- const compact = (value) => {
121
- let v = clean(value, "").trim().toUpperCase();
122
- v = v.replace(/\s*DV[:\s]*(\d{2})$/, " DV$1");
123
- v = v.replace(/\s+/g, " ");
124
- return v;
125
- };
126
- const validate = (value) => {
127
- const dvMatch = compact(value).match(/^(.+?)-?\s*DV[:\s]*(\d{2})$/);
128
- if (!dvMatch) return err("INVALID_FORMAT", "Panama RUC must include DV (dígito verificador)");
129
- const rucPart = dvMatch[1];
130
- const dvPart = dvMatch[2];
131
- const segments = rucPart.replace(/-+$/, "").split("-");
132
- if (segments.length < 3 || segments.length > 4) return err("INVALID_FORMAT", "Panama RUC must have 3–4 hyphen-separated segments");
133
- if (segments.some((s) => s.length === 0)) return err("INVALID_FORMAT", "Panama RUC segments must not be empty");
134
- const computed = computeDV(segments, rucPart);
135
- if (computed === null) return err("INVALID_FORMAT", "Unrecognized Panama RUC format");
136
- if (computed !== dvPart) return err("INVALID_CHECKSUM", "Panama RUC dígito verificador does not match");
137
- return {
138
- valid: true,
139
- compact: segments.join("-") + " DV" + dvPart
140
- };
141
- };
142
- /**
143
- * Format: display as segments with " DV XX".
144
- */
145
- const format = (value) => {
146
- const v = compact(value);
147
- const dvMatch = v.match(/^(.+?)-?\s*DV[:\s]*(\d{2})$/);
148
- if (!dvMatch) return v;
149
- const rucPart = dvMatch[1].replace(/-+$/, "");
150
- const dvPart = dvMatch[2];
151
- return `${rucPart.split("-").join("-")} DV ${dvPart}`;
152
- };
153
- /** Generate a random valid Panama RUC (natural person). */
154
- const generate = () => {
155
- const segments = [
156
- String(randomInt(1, 13)),
157
- String(randomInt(1, 9999)),
158
- String(randomInt(1, 99999))
159
- ];
160
- const dv = computeDV(segments, segments.join("-"));
161
- if (dv === null) throw new Error("Failed to compute Panama RUC DV");
162
- return `${segments.join("-")} DV${dv}`;
163
- };
164
- /** Panama tax identification number. */
165
- const ruc = {
166
- name: "Tax Identification Number",
167
- localName: "Registro Único de Contribuyente",
168
- abbreviation: "RUC",
169
- aliases: ["RUC"],
170
- candidatePattern: "\\d{1,2}-?\\d{1,4}-?\\d{1,6}",
171
- scope: "country",
172
- country: "PA",
173
- entityType: "any",
174
- description: "Tax identifier issued by Panama's DGI",
175
- sourceUrl: "https://dgi.mef.gob.pa/",
176
- examples: ["1-184-921 DV49", "2588017-1-831938 DV20"],
177
- compact,
178
- format,
179
- validate,
180
- generate
181
- };
1
+ import { createValidator } from "../runtime.js";
2
+ //#region src/generated/pa/ruc.ts
3
+ const ruc = createValidator("pa.ruc", 140);
4
+ const compact = ruc.compact;
5
+ const format = ruc.format;
6
+ const validate = ruc.validate;
7
+ const generate = () => ruc.generate?.() ?? (() => {
8
+ throw new Error("Validator pa.ruc cannot generate values");
9
+ })();
182
10
  //#endregion
183
11
  export { compact, ruc as default, format, generate, validate };
184
12
 
@@ -1 +1 @@
1
- {"version":3,"file":"ruc.js","names":[],"sources":["../../src/pa/ruc.ts"],"sourcesContent":["/**\n * RUC (Registro Único de Contribuyente, Panama\n * tax number).\n *\n * The RUC identifies taxpayers in Panama. It comes\n * in several formats depending on entity type\n * (natural person, legal entity, foreigner, etc.)\n * and is always accompanied by a two-digit check\n * code called the \"dígito verificador\" (DV).\n *\n * The DV is computed by encoding the hyphen-separated\n * RUC into a 20-position numeric buffer, then applying\n * a double weighted-sum mod 11 algorithm. The encoding\n * and legacy-format handling follow the official ANIP/DGI\n * specification.\n *\n * @see https://dgi.mef.gob.pa/\n */\n\nimport type {\n ValidateResult,\n CountryValidator,\n} from \"../types\";\n\nimport { clean } from \"#util/clean\";\nimport { randomInt } from \"#util/generate\";\nimport { err } from \"#util/result\";\n\n/**\n * Legacy cross-reference table: maps two-digit codes\n * at positions 5–6 of old-format juridical RUCs.\n */\nconst LEGACY_MAP: Record<string, string> = {\n \"00\": \"00\",\n \"10\": \"01\",\n \"11\": \"02\",\n \"12\": \"03\",\n \"13\": \"04\",\n \"14\": \"05\",\n \"15\": \"06\",\n \"16\": \"07\",\n \"17\": \"08\",\n \"18\": \"09\",\n \"19\": \"01\",\n \"20\": \"02\",\n \"21\": \"03\",\n \"22\": \"04\",\n \"23\": \"07\",\n \"24\": \"08\",\n \"25\": \"09\",\n \"26\": \"02\",\n \"27\": \"03\",\n \"28\": \"04\",\n \"29\": \"05\",\n \"30\": \"06\",\n \"31\": \"07\",\n \"32\": \"08\",\n \"33\": \"09\",\n \"34\": \"01\",\n \"35\": \"02\",\n \"36\": \"03\",\n \"37\": \"04\",\n \"38\": \"05\",\n \"39\": \"06\",\n \"40\": \"07\",\n \"41\": \"08\",\n \"42\": \"09\",\n \"43\": \"01\",\n \"44\": \"02\",\n \"45\": \"03\",\n \"46\": \"04\",\n \"47\": \"05\",\n \"48\": \"06\",\n \"49\": \"07\",\n};\n\n/** Prepend n leading zeros. */\nconst z = (n: number): string => \"0\".repeat(Math.max(0, n));\n\n/**\n * Compute a single DV digit via weighted sum mod 11.\n * Weights start at 2 and increment, applied\n * right-to-left. For old-format juridical RUCs,\n * weight 12 is skipped (jumps from 11 to 13).\n */\nconst digitDV = (\n buf: string,\n isOldFormat: boolean,\n): number => {\n let weight = 2;\n let sum = 0;\n for (let i = buf.length - 1; i >= 0; i--) {\n if (isOldFormat && weight === 12) {\n weight += 1; // skip 12, continue from 13\n }\n sum += weight * (buf.charCodeAt(i) - 48);\n weight += 1;\n }\n const r = sum % 11;\n return r > 1 ? 11 - r : 0;\n};\n\n/**\n * Encode the RUC segments into a numeric buffer\n * according to entity type, then compute the two\n * DV digits.\n *\n * Returns the two-digit DV string, or null if the\n * format is unrecognized.\n */\nconst computeDV = (\n segments: readonly string[],\n raw: string,\n): string | null => {\n const len = segments.length;\n\n if (len < 3 || len > 4) {\n return null;\n }\n // The NT designation requires exactly 4 segments\n // (xxNT-NT-xxx-xxx); any other 4-segment shape is\n // unrecognized, and a 3-segment \"NT\" in position 1\n // is malformed.\n if ((len === 4) !== (segments[1] === \"NT\")) {\n return null;\n }\n\n let buf: string;\n let isOld = false;\n\n // SAFETY: length check above ensures 3..4 segments.\n // eslint-disable-next-line no-non-null-assertion\n const s0 = segments[0]!;\n // eslint-disable-next-line no-non-null-assertion\n const s1 = segments[1]!;\n // eslint-disable-next-line no-non-null-assertion\n const s2 = segments[2]!;\n\n if (raw[0] === \"E\") {\n // Foreign person (E-xxx-xxx)\n buf =\n z(4 - s1.length) +\n \"0000005\" +\n \"00\" +\n \"50\" +\n z(3 - s1.length) +\n s1 +\n z(5 - s2.length) +\n s2;\n } else if (s1 === \"NT\") {\n // NT designation (xxNT-NT-xxx-xxx)\n // SAFETY: NT branch implies len === 4 (checked above).\n // eslint-disable-next-line no-non-null-assertion\n const s3 = segments[3]!;\n const prefix = s0.slice(0, -2);\n buf =\n z(4 - s1.length) +\n \"0000005\" +\n z(4 - prefix.length) +\n prefix +\n \"43\" +\n z(3 - s2.length) +\n s2 +\n z(5 - s3.length) +\n s3;\n } else if (s0.endsWith(\"AV\")) {\n // AV suffix\n const prefix = s0.slice(0, -2);\n buf =\n z(4 - s1.length) +\n \"0000005\" +\n z(4 - prefix.length) +\n prefix +\n \"15\" +\n z(3 - s1.length) +\n s1 +\n z(5 - s2.length) +\n s2;\n } else if (s0.endsWith(\"PI\")) {\n // PI suffix\n const prefix = s0.slice(0, -2);\n buf =\n z(4 - s1.length) +\n \"0000005\" +\n z(4 - prefix.length) +\n prefix +\n \"79\" +\n z(3 - s1.length) +\n s1 +\n z(5 - s2.length) +\n s2;\n } else if (s0 === \"PE\") {\n // PE prefix (foreign-born)\n buf =\n z(4 - s1.length) +\n \"0000005\" +\n \"00\" +\n \"75\" +\n z(3 - s1.length) +\n s1 +\n z(5 - s2.length) +\n s2;\n } else if (raw[0] === \"N\") {\n // N prefix (naturalized citizen)\n buf =\n z(4 - s1.length) +\n \"0000005\" +\n \"00\" +\n \"40\" +\n z(3 - s1.length) +\n s1 +\n z(5 - s2.length) +\n s2;\n } else if (s0.length >= 1 && s0.length <= 2) {\n // Natural person (province 1–2 digits)\n buf =\n z(4 - s1.length) +\n \"0000005\" +\n z(2 - s0.length) +\n s0 +\n \"00\" +\n z(3 - s1.length) +\n s1 +\n z(5 - s2.length) +\n s2;\n } else {\n // Juridical (company)\n buf =\n z(10 - s0.length) +\n s0 +\n z(4 - s1.length) +\n s1 +\n z(6 - s2.length) +\n s2;\n // SAFETY: juridical branch zero-pads s0 to at least\n // 10 chars (z(10 - s0.length)), so buf[3..6] are\n // always defined.\n isOld =\n buf[3] === \"0\" &&\n buf[4] === \"0\" &&\n // eslint-disable-next-line no-non-null-assertion\n buf[5]! < \"5\";\n }\n\n // Apply legacy cross-reference for old format\n if (isOld) {\n const key = buf.slice(5, 7);\n const mapped = LEGACY_MAP[key] ?? key;\n buf = buf.slice(0, 5) + mapped + buf.slice(7);\n }\n\n const dv1 = digitDV(buf, isOld);\n const dv2 = digitDV(\n buf + String.fromCharCode(48 + dv1),\n isOld,\n );\n\n return `${dv1}${dv2}`;\n};\n\n/**\n * Compact: normalize Unicode, collapse whitespace,\n * strip colons around DV, and uppercase. Keeps\n * hyphens (structural separators) and a single\n * space before \"DV\".\n */\nconst compact = (value: string): string => {\n let v = clean(value, \"\").trim().toUpperCase();\n // Normalize DV portion: \" DV: 49\" -> \" DV49\"\n v = v.replace(/\\s*DV[:\\s]*(\\d{2})$/, \" DV$1\");\n // Collapse any remaining internal whitespace\n v = v.replace(/\\s+/g, \" \");\n return v;\n};\n\nconst validate = (value: string): ValidateResult => {\n const v = compact(value);\n\n // Extract the DV portion: \"...DV49\", \"...DV:49\",\n // or \"... DV 49\"\n const dvMatch = v.match(/^(.+?)-?\\s*DV[:\\s]*(\\d{2})$/);\n\n if (!dvMatch) {\n return err(\n \"INVALID_FORMAT\",\n \"Panama RUC must include DV \" +\n \"(dígito verificador)\",\n );\n }\n\n // SAFETY: both DV regex capture groups are required.\n // eslint-disable-next-line no-non-null-assertion\n const rucPart = dvMatch[1]!;\n // eslint-disable-next-line no-non-null-assertion\n const dvPart = dvMatch[2]!;\n\n // The RUC part should be hyphen-separated segments\n const segments = rucPart.replace(/-+$/, \"\").split(\"-\");\n\n if (segments.length < 3 || segments.length > 4) {\n return err(\n \"INVALID_FORMAT\",\n \"Panama RUC must have 3–4 \" +\n \"hyphen-separated segments\",\n );\n }\n\n if (segments.some((s) => s.length === 0)) {\n return err(\n \"INVALID_FORMAT\",\n \"Panama RUC segments must not be empty\",\n );\n }\n\n const computed = computeDV(segments, rucPart);\n if (computed === null) {\n return err(\n \"INVALID_FORMAT\",\n \"Unrecognized Panama RUC format\",\n );\n }\n\n if (computed !== dvPart) {\n return err(\n \"INVALID_CHECKSUM\",\n \"Panama RUC dígito verificador \" + \"does not match\",\n );\n }\n\n const compactForm = segments.join(\"-\") + \" DV\" + dvPart;\n return { valid: true, compact: compactForm };\n};\n\n/**\n * Format: display as segments with \" DV XX\".\n */\nconst format = (value: string): string => {\n const v = compact(value);\n const dvMatch = v.match(/^(.+?)-?\\s*DV[:\\s]*(\\d{2})$/);\n if (!dvMatch) return v;\n\n // SAFETY: both DV regex capture groups are required.\n // eslint-disable-next-line no-non-null-assertion\n const rucPart = dvMatch[1]!.replace(/-+$/, \"\");\n // eslint-disable-next-line no-non-null-assertion\n const dvPart = dvMatch[2]!;\n const segments = rucPart.split(\"-\");\n return `${segments.join(\"-\")} DV ${dvPart}`;\n};\n\n/** Generate a random valid Panama RUC (natural person). */\nconst generate = (): string => {\n const province = String(randomInt(1, 13));\n const volume = String(randomInt(1, 9999));\n const folio = String(randomInt(1, 99999));\n const segments = [province, volume, folio];\n const dv = computeDV(segments, segments.join(\"-\"));\n if (dv === null) {\n throw new Error(\"Failed to compute Panama RUC DV\");\n }\n return `${segments.join(\"-\")} DV${dv}`;\n};\n\n/** Panama tax identification number. */\nconst ruc: CountryValidator<\"PA\"> = {\n name: \"Tax Identification Number\",\n localName: \"Registro Único de Contribuyente\",\n abbreviation: \"RUC\",\n aliases: [\"RUC\"] as const,\n candidatePattern: \"\\\\d{1,2}-?\\\\d{1,4}-?\\\\d{1,6}\",\n scope: \"country\",\n country: \"PA\",\n entityType: \"any\",\n description: \"Tax identifier issued by Panama's DGI\",\n sourceUrl: \"https://dgi.mef.gob.pa/\",\n examples: [\n \"1-184-921 DV49\",\n \"2588017-1-831938 DV20\",\n ] as const,\n compact,\n format,\n validate,\n generate,\n};\n\nexport default ruc;\nexport { compact, format, validate, generate };\n"],"mappings":"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"}
1
+ {"version":3,"file":"ruc.js","names":[],"sources":["../../src/generated/pa/ruc.ts"],"sourcesContent":["// Generated by scripts/generate-public-surface.ts. Do not edit.\nimport { createValidator } from \"../../runtime\";\nimport type { CountryValidator } from \"../../types\";\n\nconst ruc: CountryValidator<\"PA\"> = createValidator(\n \"pa.ruc\",\n 140,\n);\n\nexport default ruc;\nexport const compact = ruc.compact;\nexport const format = ruc.format;\nexport const validate = ruc.validate;\nexport const generate = (): string =>\n ruc.generate?.() ??\n (() => {\n throw new Error(\n \"Validator pa.ruc cannot generate values\",\n );\n })();\n"],"mappings":";;AAIA,MAAM,MAA8B,gBAClC,UACA,GACF;AAGA,MAAa,UAAU,IAAI;AAC3B,MAAa,SAAS,IAAI;AAC1B,MAAa,WAAW,IAAI;AAC5B,MAAa,iBACX,IAAI,WAAW,YACR;CACL,MAAM,IAAI,MACR,yCACF;AACF,EAAA,CAAG"}
@@ -1,43 +1,14 @@
1
- import { CountryCode, CountryValidator, Validator } from "./types.js";
2
-
1
+ import { CountryCode, CountryValidator, GlobalValidator, ParsedBirthDate, ParsedPersonId, Validator } from "./types.js";
3
2
  //#region src/patterns.d.ts
4
3
  type ValidatorPattern<TValidator extends Validator = Validator> = {
5
- /** The validator this pattern was derived from. */validator: TValidator; /** Loose regex matching candidates in text. */
4
+ validator: TValidator;
6
5
  regex: RegExp;
7
6
  };
8
- /**
9
- * Derive a loose candidate-matching regex from
10
- * a validator. The regex finds potential matches;
11
- * use `validate()` to confirm.
12
- *
13
- * Handles both digit-only (IČO, NIP) and
14
- * alphanumeric (IBAN, BIC, ISIN, LEI) validators.
15
- */
16
- declare const toRegex: (v: Validator) => RegExp;
17
- /**
18
- * All discovered validators, lazily populated.
19
- * Import * from "../src" would pull everything;
20
- * instead, callers pass validators explicitly.
21
- */
22
- /**
23
- * Build patterns for a list of validators.
24
- */
7
+ declare const toRegex: (validator: Validator) => RegExp;
25
8
  declare const toPatterns: <TValidator extends Validator>(validators: readonly TValidator[]) => ValidatorPattern<TValidator>[];
26
- /**
27
- * Filter validators by country code and build
28
- * patterns.
29
- */
30
- type CountryScopedValidator<TValidator extends Validator, TCountry extends CountryCode> = TValidator extends CountryValidator<infer TValidatorCountry, infer TParsed> ? TCountry extends TValidatorCountry ? TValidator & CountryValidator<TCountry, TParsed> : TValidatorCountry extends TCountry ? TValidator : never : never;
31
- declare const byCountry: <TCountry extends CountryCode, TValidator extends Validator>(country: TCountry, validators: readonly TValidator[]) => ValidatorPattern<CountryScopedValidator<TValidator, TCountry>>[];
32
- /**
33
- * Filter validators by entity type and build
34
- * patterns.
35
- */
36
- declare const byEntityType: <TValidator extends Validator>(entityType: "person" | "company" | "any", validators: readonly TValidator[]) => ValidatorPattern<TValidator>[];
37
- /**
38
- * Build patterns for ALL provided validators.
39
- */
40
- declare const allPatterns: <TValidator extends Validator>(validators: readonly TValidator[]) => ValidatorPattern<TValidator>[];
9
+ declare const byCountry: <TCountry extends CountryCode>(country: TCountry) => ValidatorPattern<CountryValidator<TCountry>>[];
10
+ declare const byEntityType: (entityType: Validator["entityType"]) => ValidatorPattern<CountryValidator<"AD"> | CountryValidator<"AE"> | CountryValidator<"AI"> | CountryValidator<"AL"> | CountryValidator<"AM"> | CountryValidator<"AR"> | CountryValidator<"AT"> | CountryValidator<"AU"> | CountryValidator<"AZ"> | CountryValidator<"BD"> | CountryValidator<"BE"> | CountryValidator<"BG"> | CountryValidator<"BH"> | CountryValidator<"BR"> | CountryValidator<"BY"> | CountryValidator<"BZ"> | CountryValidator<"CA"> | CountryValidator<"CH"> | CountryValidator<"CL"> | CountryValidator<"CN"> | CountryValidator<"CO"> | CountryValidator<"CR"> | CountryValidator<"CY"> | CountryValidator<"CZ"> | CountryValidator<"DE"> | CountryValidator<"DK"> | CountryValidator<"DO"> | CountryValidator<"EC"> | CountryValidator<"EE"> | CountryValidator<"EG"> | CountryValidator<"ES"> | CountryValidator<"FI"> | CountryValidator<"FR"> | CountryValidator<"GB"> | CountryValidator<"GE"> | CountryValidator<"GH"> | CountryValidator<"GR"> | CountryValidator<"GT"> | CountryValidator<"HK"> | CountryValidator<"HR"> | CountryValidator<"HU"> | CountryValidator<"ID"> | CountryValidator<"IE"> | CountryValidator<"IL"> | CountryValidator<"IN"> | CountryValidator<"IQ"> | CountryValidator<"IR"> | CountryValidator<"IS"> | CountryValidator<"IT"> | CountryValidator<"JP"> | CountryValidator<"KR"> | CountryValidator<"LI"> | CountryValidator<"LT"> | CountryValidator<"LU"> | CountryValidator<"LV"> | CountryValidator<"MA"> | CountryValidator<"MC"> | CountryValidator<"MD"> | CountryValidator<"ME"> | CountryValidator<"MK"> | CountryValidator<"MT"> | CountryValidator<"MU"> | CountryValidator<"MX"> | CountryValidator<"NG"> | CountryValidator<"NI"> | CountryValidator<"NL"> | CountryValidator<"NO"> | CountryValidator<"NZ"> | CountryValidator<"PA"> | CountryValidator<"PE"> | CountryValidator<"PH"> | CountryValidator<"PK"> | CountryValidator<"PL"> | CountryValidator<"PT"> | CountryValidator<"RO"> | CountryValidator<"RS"> | CountryValidator<"RU"> | CountryValidator<"SE"> | CountryValidator<"SG"> | CountryValidator<"SI"> | CountryValidator<"SK"> | CountryValidator<"TH"> | CountryValidator<"TR"> | CountryValidator<"TW"> | CountryValidator<"UA"> | CountryValidator<"US"> | CountryValidator<"UY"> | CountryValidator<"VE"> | CountryValidator<"VN"> | CountryValidator<"BA", ParsedPersonId> | CountryValidator<"BG", ParsedPersonId> | CountryValidator<"CN", ParsedPersonId> | CountryValidator<"CU", ParsedPersonId> | CountryValidator<"CZ", ParsedPersonId> | CountryValidator<"DK", ParsedPersonId> | CountryValidator<"EE", ParsedPersonId> | CountryValidator<"FI", ParsedPersonId> | CountryValidator<"FR", ParsedPersonId> | CountryValidator<"IT", ParsedPersonId> | CountryValidator<"KR", ParsedPersonId> | CountryValidator<"KW", ParsedBirthDate> | CountryValidator<"KZ", ParsedPersonId> | CountryValidator<"LK", ParsedPersonId> | CountryValidator<"MX", ParsedPersonId> | CountryValidator<"MY", ParsedPersonId> | CountryValidator<"NO", ParsedPersonId> | CountryValidator<"PL", ParsedPersonId> | CountryValidator<"RO", ParsedPersonId> | CountryValidator<"SE", ParsedPersonId> | CountryValidator<"SI", ParsedPersonId> | CountryValidator<"SK", ParsedPersonId> | CountryValidator<"ZA", ParsedPersonId> | GlobalValidator>[];
11
+ declare const allPatterns: () => ValidatorPattern<CountryValidator<"AD"> | CountryValidator<"AE"> | CountryValidator<"AI"> | CountryValidator<"AL"> | CountryValidator<"AM"> | CountryValidator<"AR"> | CountryValidator<"AT"> | CountryValidator<"AU"> | CountryValidator<"AZ"> | CountryValidator<"BD"> | CountryValidator<"BE"> | CountryValidator<"BG"> | CountryValidator<"BH"> | CountryValidator<"BR"> | CountryValidator<"BY"> | CountryValidator<"BZ"> | CountryValidator<"CA"> | CountryValidator<"CH"> | CountryValidator<"CL"> | CountryValidator<"CN"> | CountryValidator<"CO"> | CountryValidator<"CR"> | CountryValidator<"CY"> | CountryValidator<"CZ"> | CountryValidator<"DE"> | CountryValidator<"DK"> | CountryValidator<"DO"> | CountryValidator<"EC"> | CountryValidator<"EE"> | CountryValidator<"EG"> | CountryValidator<"ES"> | CountryValidator<"FI"> | CountryValidator<"FR"> | CountryValidator<"GB"> | CountryValidator<"GE"> | CountryValidator<"GH"> | CountryValidator<"GR"> | CountryValidator<"GT"> | CountryValidator<"HK"> | CountryValidator<"HR"> | CountryValidator<"HU"> | CountryValidator<"ID"> | CountryValidator<"IE"> | CountryValidator<"IL"> | CountryValidator<"IN"> | CountryValidator<"IQ"> | CountryValidator<"IR"> | CountryValidator<"IS"> | CountryValidator<"IT"> | CountryValidator<"JP"> | CountryValidator<"KR"> | CountryValidator<"LI"> | CountryValidator<"LT"> | CountryValidator<"LU"> | CountryValidator<"LV"> | CountryValidator<"MA"> | CountryValidator<"MC"> | CountryValidator<"MD"> | CountryValidator<"ME"> | CountryValidator<"MK"> | CountryValidator<"MT"> | CountryValidator<"MU"> | CountryValidator<"MX"> | CountryValidator<"NG"> | CountryValidator<"NI"> | CountryValidator<"NL"> | CountryValidator<"NO"> | CountryValidator<"NZ"> | CountryValidator<"PA"> | CountryValidator<"PE"> | CountryValidator<"PH"> | CountryValidator<"PK"> | CountryValidator<"PL"> | CountryValidator<"PT"> | CountryValidator<"RO"> | CountryValidator<"RS"> | CountryValidator<"RU"> | CountryValidator<"SE"> | CountryValidator<"SG"> | CountryValidator<"SI"> | CountryValidator<"SK"> | CountryValidator<"TH"> | CountryValidator<"TR"> | CountryValidator<"TW"> | CountryValidator<"UA"> | CountryValidator<"US"> | CountryValidator<"UY"> | CountryValidator<"VE"> | CountryValidator<"VN"> | CountryValidator<"BA", ParsedPersonId> | CountryValidator<"BG", ParsedPersonId> | CountryValidator<"CN", ParsedPersonId> | CountryValidator<"CU", ParsedPersonId> | CountryValidator<"CZ", ParsedPersonId> | CountryValidator<"DK", ParsedPersonId> | CountryValidator<"EE", ParsedPersonId> | CountryValidator<"FI", ParsedPersonId> | CountryValidator<"FR", ParsedPersonId> | CountryValidator<"IT", ParsedPersonId> | CountryValidator<"KR", ParsedPersonId> | CountryValidator<"KW", ParsedBirthDate> | CountryValidator<"KZ", ParsedPersonId> | CountryValidator<"LK", ParsedPersonId> | CountryValidator<"MX", ParsedPersonId> | CountryValidator<"MY", ParsedPersonId> | CountryValidator<"NO", ParsedPersonId> | CountryValidator<"PL", ParsedPersonId> | CountryValidator<"RO", ParsedPersonId> | CountryValidator<"SE", ParsedPersonId> | CountryValidator<"SI", ParsedPersonId> | CountryValidator<"SK", ParsedPersonId> | CountryValidator<"ZA", ParsedPersonId> | GlobalValidator>[];
41
12
  //#endregion
42
13
  export { ValidatorPattern, allPatterns, byCountry, byEntityType, toPatterns, toRegex };
43
14
  //# sourceMappingURL=patterns.d.ts.map
package/dist/patterns.js CHANGED
@@ -1,177 +1,16 @@
1
+ import { allValidators } from "./registry.js";
1
2
  //#region src/patterns.ts
2
- /** Separator chars that compact() strips. */
3
- const SEP = "[\\s\\-./]?";
4
- /**
5
- * Infer compact lengths from metadata or examples.
6
- */
7
- const inferLengths = (v) => {
8
- if (v.lengths && v.lengths.length > 0) return [...v.lengths];
9
- if (v.examples && v.examples.length > 0) {
10
- const lens = /* @__PURE__ */ new Set();
11
- for (const ex of v.examples) lens.add(v.compact(ex).length);
12
- return [...lens];
13
- }
14
- return [];
3
+ const toRegex = (validator) => {
4
+ if (validator.candidatePattern === void 0) throw new Error(`${validator.name} does not define a candidate pattern`);
5
+ return new RegExp(validator.candidatePattern, "g");
15
6
  };
16
- /**
17
- * Derive the display grouping from format().
18
- * Returns an array of group sizes, e.g.,
19
- * "25 123 891" → [2, 3, 3].
20
- */
21
- const inferGroups = (v) => {
22
- const first = v.examples?.[0];
23
- if (first === void 0) return null;
24
- const compact = v.compact(first);
25
- const formatted = v.format(compact);
26
- if (formatted === compact) return null;
27
- const parts = formatted.split(/[^a-zA-Z0-9]+/);
28
- if (parts.length <= 1) return null;
29
- const isAlphanumeric = parts.some((p) => /[a-zA-Z]/.test(p) && /\d/.test(p));
30
- const groups = parts.filter((p) => p.length > 0 && (isAlphanumeric || /\d/.test(p))).map((p) => p.length);
31
- return groups.length > 1 ? groups : null;
32
- };
33
- /**
34
- * Detect if this validator uses a known prefix
35
- * (e.g., "CZ" for DIČ, "CHE" for Swiss UID).
36
- */
37
- const inferPrefix = (v) => {
38
- const examples = v.examples;
39
- const first = examples?.[0];
40
- if (!examples || first === void 0) return null;
41
- const compact = v.compact(first);
42
- const compactPrefix = compact.match(/^([A-Z]+)\d/)?.[1];
43
- if (compactPrefix !== void 0 && examples.length > 1) {
44
- if (examples.every((ex) => v.compact(ex).startsWith(compactPrefix))) return compactPrefix;
45
- } else if (compactPrefix !== void 0 && examples.length === 1) return compactPrefix;
46
- const fmtPrefix = v.format(compact).match(/^([A-Z]+)[\s\-./]?\d/)?.[1];
47
- if (fmtPrefix !== void 0 && !compact.startsWith(fmtPrefix)) return fmtPrefix;
48
- return null;
49
- };
50
- /**
51
- * Character class for a string fragment:
52
- * `\d` if all digits, `[A-Z]` if all letters,
53
- * `[A-Z0-9]` if mixed.
54
- */
55
- const charClassFor = (s) => {
56
- let hasLetter = false;
57
- let hasDigit = false;
58
- for (const ch of s) {
59
- if (/[a-zA-Z]/.test(ch)) hasLetter = true;
60
- if (/\d/.test(ch)) hasDigit = true;
61
- }
62
- if (hasLetter && hasDigit) return "[A-Z0-9]";
63
- if (hasLetter) return "[A-Z]";
64
- return "\\d";
65
- };
66
- /**
67
- * Determine the character class needed for the
68
- * compact form: `\d` if all digits, `[A-Z0-9]`
69
- * if alphanumeric, etc.
70
- */
71
- const inferCharClass = (v) => {
72
- if (!v.examples || v.examples.length === 0) return "\\d";
73
- return charClassFor(v.examples.map((ex) => v.compact(ex)).join(""));
74
- };
75
- /**
76
- * Infer per-group sizes AND character classes from
77
- * format(). Returns groups with per-position char
78
- * classes, e.g., "12 010188 M 01 1" →
79
- * sizes: [2, 6, 1, 2, 1]
80
- * classes: ["\d", "\d", "[A-Z]", "\d", "\d"]
81
- *
82
- * Only returns non-null when per-group classes
83
- * differ (some groups are letters, some digits).
84
- * Letter-only groups before the first digit group
85
- * are treated as prefixes and excluded (handled
86
- * by inferPrefix separately).
87
- */
88
- const inferPerGroup = (v) => {
89
- const first = v.examples?.[0];
90
- if (first === void 0) return null;
91
- const compact = v.compact(first);
92
- const formatted = v.format(compact);
93
- if (formatted === compact) return null;
94
- if (!(/[a-zA-Z]/.test(compact) && /\d/.test(compact))) return null;
95
- const parts = formatted.split(/[^a-zA-Z0-9]+/);
96
- if (parts.some((p) => /[a-zA-Z]/.test(p) && /\d/.test(p))) return null;
97
- const filtered = [];
98
- let seenDigitGroup = false;
99
- for (const p of parts) {
100
- if (p.length === 0) continue;
101
- if (/\d/.test(p)) {
102
- seenDigitGroup = true;
103
- filtered.push({
104
- size: p.length,
105
- charClass: charClassFor(p)
106
- });
107
- } else if (seenDigitGroup) filtered.push({
108
- size: p.length,
109
- charClass: charClassFor(p)
110
- });
111
- }
112
- if (filtered.length <= 1) return null;
113
- const firstClass = filtered[0]?.charClass;
114
- if (filtered.every((g) => g.charClass === firstClass)) return null;
115
- return filtered;
116
- };
117
- /**
118
- * Build a group regex from group sizes + char class.
119
- * [2, 3, 3] with \d → /\d{2}[\s\-.]?\d{3}[\s\-.]?\d{3}/
120
- */
121
- const groupsToPattern = (groups, cc) => groups.map((g) => `${cc}{${g}}`).join(SEP);
122
- /**
123
- * Build a group regex with per-group char classes.
124
- * Produces tighter patterns when groups have different
125
- * character types (e.g., digits vs letters).
126
- */
127
- const groupsToPatternPerClass = (groups) => groups.map(({ size, charClass }) => `${charClass}{${size}}`).join(SEP);
128
- /**
129
- * Derive a loose candidate-matching regex from
130
- * a validator. The regex finds potential matches;
131
- * use `validate()` to confirm.
132
- *
133
- * Handles both digit-only (IČO, NIP) and
134
- * alphanumeric (IBAN, BIC, ISIN, LEI) validators.
135
- */
136
- const toRegex = (v) => {
137
- const prefix = inferPrefix(v);
138
- const groups = inferGroups(v);
139
- const lengths = inferLengths(v);
140
- const cc = inferCharClass(v);
141
- let pattern;
142
- const perGroup = inferPerGroup(v);
143
- if (perGroup && lengths.length <= 1) pattern = groupsToPatternPerClass(perGroup);
144
- else if (groups && lengths.length <= 1) pattern = groupsToPattern(groups, cc);
145
- else if (lengths.length === 1) pattern = `${cc}{${lengths[0]}}`;
146
- else if (lengths.length > 1) pattern = `${cc}{${Math.min(...lengths)},${Math.max(...lengths)}}`;
147
- else pattern = `${cc}{6,20}`;
148
- if (prefix) pattern = `${prefix}${SEP}${pattern}`;
149
- return new RegExp(`(?<!\\w)${pattern}(?!\\w)`, "g");
150
- };
151
- /**
152
- * All discovered validators, lazily populated.
153
- * Import * from "../src" would pull everything;
154
- * instead, callers pass validators explicitly.
155
- */
156
- /**
157
- * Build patterns for a list of validators.
158
- */
159
- const toPatterns = (validators) => validators.map((v) => ({
160
- validator: v,
161
- regex: toRegex(v)
7
+ const toPatterns = (validators) => validators.filter((validator) => validator.candidatePattern !== void 0).map((validator) => ({
8
+ validator,
9
+ regex: toRegex(validator)
162
10
  }));
163
- const byCountry = (country, validators) => {
164
- return toPatterns(validators.filter((v) => v.scope === "country" && v.country === country));
165
- };
166
- /**
167
- * Filter validators by entity type and build
168
- * patterns.
169
- */
170
- const byEntityType = (entityType, validators) => toPatterns(validators.filter((v) => entityType === "any" || v.entityType === entityType || v.entityType === "any"));
171
- /**
172
- * Build patterns for ALL provided validators.
173
- */
174
- const allPatterns = (validators) => toPatterns(validators);
11
+ const byCountry = (country) => toPatterns(allValidators.filter((validator) => validator.scope === "country" && validator.country === country));
12
+ const byEntityType = (entityType) => toPatterns(allValidators.filter((validator) => validator.entityType === entityType));
13
+ const allPatterns = () => toPatterns(allValidators);
175
14
  //#endregion
176
15
  export { allPatterns, byCountry, byEntityType, toPatterns, toRegex };
177
16
 
@@ -1 +1 @@
1
- {"version":3,"file":"patterns.js","names":[],"sources":["../src/patterns.ts"],"sourcesContent":["/**\n * Derive candidate-matching regex patterns from\n * validators. These patterns find CANDIDATES in\n * text — use `validate()` to confirm each match.\n *\n * Designed for integration with regex-set or\n * similar multi-pattern scanning engines.\n *\n * @example\n * ```ts\n * import {\n * toRegex, byCountry, byEntityType,\n * } from \"@stll/stdnum/patterns\";\n * import { cz } from \"@stll/stdnum\";\n *\n * // Single validator\n * toRegex(cz.ico);\n * // → /(?<!\\w)\\d{8}(?!\\w)/g\n *\n * // All Czech validators\n * byCountry(\"CZ\");\n * // → [{ validator: cz.ico, regex }, ...]\n *\n * // All company identifiers\n * byEntityType(\"company\");\n * // → [{ validator, regex }, ...]\n * ```\n */\n\nimport type {\n CountryCode,\n CountryValidator,\n Validator,\n} from \"./types\";\n\n// ─── Pattern type ─────────────────────────────\n\nexport type ValidatorPattern<\n TValidator extends Validator = Validator,\n> = {\n /** The validator this pattern was derived from. */\n validator: TValidator;\n /** Loose regex matching candidates in text. */\n regex: RegExp;\n};\n\n// ─── Regex derivation ─────────────────────────\n\n/** Separator chars that compact() strips. */\nconst SEP = \"[\\\\s\\\\-./]?\";\n\n/**\n * Infer compact lengths from metadata or examples.\n */\nconst inferLengths = (v: Validator): number[] => {\n if (v.lengths && v.lengths.length > 0) {\n return [...v.lengths];\n }\n if (v.examples && v.examples.length > 0) {\n const lens = new Set<number>();\n for (const ex of v.examples) {\n lens.add(v.compact(ex).length);\n }\n return [...lens];\n }\n return [];\n};\n\n/**\n * Derive the display grouping from format().\n * Returns an array of group sizes, e.g.,\n * \"25 123 891\" → [2, 3, 3].\n */\nconst inferGroups = (v: Validator): number[] | null => {\n const first = v.examples?.[0];\n if (first === undefined) return null;\n const compact = v.compact(first);\n const formatted = v.format(compact);\n if (formatted === compact) return null;\n\n // Split on non-alphanumeric separators\n const parts = formatted.split(/[^a-zA-Z0-9]+/);\n if (parts.length <= 1) return null;\n\n // For digit-only validators, skip letter-only\n // tokens (prefix like \"CHE\"). For alphanumeric\n // validators (IBAN, ISIN), keep all groups.\n const isAlphanumeric = parts.some(\n (p) => /[a-zA-Z]/.test(p) && /\\d/.test(p),\n );\n const groups = parts\n .filter(\n (p) =>\n p.length > 0 && (isAlphanumeric || /\\d/.test(p)),\n )\n .map((p) => p.length);\n\n return groups.length > 1 ? groups : null;\n};\n\n/**\n * Detect if this validator uses a known prefix\n * (e.g., \"CZ\" for DIČ, \"CHE\" for Swiss UID).\n */\nconst inferPrefix = (v: Validator): string | null => {\n const examples = v.examples;\n const first = examples?.[0];\n if (!examples || first === undefined) return null;\n const compact = v.compact(first);\n // Prefix already present in compact form.\n // But only if ALL examples share the same prefix\n // (e.g., \"CHE\" for Swiss UID). If examples have\n // different prefixes (IBAN: GB/DE/FR), there's\n // no fixed prefix — it's part of the value.\n const compactMatch = compact.match(/^([A-Z]+)\\d/);\n const compactPrefix = compactMatch?.[1];\n if (compactPrefix !== undefined && examples.length > 1) {\n const allSame = examples.every((ex) =>\n v.compact(ex).startsWith(compactPrefix),\n );\n if (allSame) return compactPrefix;\n } else if (\n compactPrefix !== undefined &&\n examples.length === 1\n ) {\n return compactPrefix;\n }\n // Prefix added only by format()\n // (e.g., \"DE\" for de.vat, \"CZ\" for cz.dic)\n const formatted = v.format(compact);\n const fmtMatch = formatted.match(/^([A-Z]+)[\\s\\-./]?\\d/);\n const fmtPrefix = fmtMatch?.[1];\n if (\n fmtPrefix !== undefined &&\n !compact.startsWith(fmtPrefix)\n ) {\n return fmtPrefix;\n }\n return null;\n};\n\n/**\n * Character class for a string fragment:\n * `\\d` if all digits, `[A-Z]` if all letters,\n * `[A-Z0-9]` if mixed.\n */\nconst charClassFor = (s: string): string => {\n let hasLetter = false;\n let hasDigit = false;\n for (const ch of s) {\n if (/[a-zA-Z]/.test(ch)) hasLetter = true;\n if (/\\d/.test(ch)) hasDigit = true;\n }\n if (hasLetter && hasDigit) return \"[A-Z0-9]\";\n if (hasLetter) return \"[A-Z]\";\n return \"\\\\d\";\n};\n\n/**\n * Determine the character class needed for the\n * compact form: `\\d` if all digits, `[A-Z0-9]`\n * if alphanumeric, etc.\n */\nconst inferCharClass = (v: Validator): string => {\n if (!v.examples || v.examples.length === 0) {\n return \"\\\\d\";\n }\n const combined = v.examples\n .map((ex) => v.compact(ex))\n .join(\"\");\n return charClassFor(combined);\n};\n\ntype PerGroup = { size: number; charClass: string };\n\n/**\n * Infer per-group sizes AND character classes from\n * format(). Returns groups with per-position char\n * classes, e.g., \"12 010188 M 01 1\" →\n * sizes: [2, 6, 1, 2, 1]\n * classes: [\"\\d\", \"\\d\", \"[A-Z]\", \"\\d\", \"\\d\"]\n *\n * Only returns non-null when per-group classes\n * differ (some groups are letters, some digits).\n * Letter-only groups before the first digit group\n * are treated as prefixes and excluded (handled\n * by inferPrefix separately).\n */\nconst inferPerGroup = (v: Validator): PerGroup[] | null => {\n const first = v.examples?.[0];\n if (first === undefined) return null;\n const compact = v.compact(first);\n const formatted = v.format(compact);\n if (formatted === compact) return null;\n\n // Only applies to mixed validators (compact has\n // both letters and digits in separate positions,\n // like German SVNR \"12010188M011\").\n const compactMixed =\n /[a-zA-Z]/.test(compact) && /\\d/.test(compact);\n if (!compactMixed) return null;\n\n // Also skip if any single part mixes letters and\n // digits (IBAN, ISIN) — inferGroups already\n // handles those correctly with the global class.\n const parts = formatted.split(/[^a-zA-Z0-9]+/);\n const isAlphanumeric = parts.some(\n (p) => /[a-zA-Z]/.test(p) && /\\d/.test(p),\n );\n if (isAlphanumeric) return null;\n\n // Keep digit groups and letter-only groups that\n // appear AFTER the first digit group (embedded\n // letters). Skip letter-only groups before the\n // first digit group (prefix like \"CHE\").\n const filtered: PerGroup[] = [];\n let seenDigitGroup = false;\n for (const p of parts) {\n if (p.length === 0) continue;\n if (/\\d/.test(p)) {\n seenDigitGroup = true;\n filtered.push({\n size: p.length,\n charClass: charClassFor(p),\n });\n } else if (seenDigitGroup) {\n filtered.push({\n size: p.length,\n charClass: charClassFor(p),\n });\n }\n }\n\n if (filtered.length <= 1) return null;\n\n const firstClass = filtered[0]?.charClass;\n const allSame = filtered.every(\n (g) => g.charClass === firstClass,\n );\n if (allSame) return null;\n\n return filtered;\n};\n\n/**\n * Build a group regex from group sizes + char class.\n * [2, 3, 3] with \\d → /\\d{2}[\\s\\-.]?\\d{3}[\\s\\-.]?\\d{3}/\n */\nconst groupsToPattern = (\n groups: number[],\n cc: string,\n): string => groups.map((g) => `${cc}{${g}}`).join(SEP);\n\n/**\n * Build a group regex with per-group char classes.\n * Produces tighter patterns when groups have different\n * character types (e.g., digits vs letters).\n */\nconst groupsToPatternPerClass = (\n groups: readonly { size: number; charClass: string }[],\n): string =>\n groups\n .map(({ size, charClass }) => `${charClass}{${size}}`)\n .join(SEP);\n\n/**\n * Derive a loose candidate-matching regex from\n * a validator. The regex finds potential matches;\n * use `validate()` to confirm.\n *\n * Handles both digit-only (IČO, NIP) and\n * alphanumeric (IBAN, BIC, ISIN, LEI) validators.\n */\nexport const toRegex = (v: Validator): RegExp => {\n const prefix = inferPrefix(v);\n const groups = inferGroups(v);\n const lengths = inferLengths(v);\n const cc = inferCharClass(v);\n\n let pattern: string;\n\n // Use per-group char classes when groups mix\n // digits and letters (e.g., German SVNR:\n // \"12 010188 M 01 1\" → [\\d, \\d, [A-Z], \\d, \\d]).\n // This prevents overly broad [A-Z0-9] from\n // matching all-caps prose as identifiers.\n const perGroup = inferPerGroup(v);\n\n if (perGroup && lengths.length <= 1) {\n pattern = groupsToPatternPerClass(perGroup);\n } else if (groups && lengths.length <= 1) {\n pattern = groupsToPattern(groups, cc);\n } else if (lengths.length === 1) {\n pattern = `${cc}{${lengths[0]}}`;\n } else if (lengths.length > 1) {\n const min = Math.min(...lengths);\n const max = Math.max(...lengths);\n pattern = `${cc}{${min},${max}}`;\n } else {\n pattern = `${cc}{6,20}`;\n }\n\n if (prefix) {\n pattern = `${prefix}${SEP}${pattern}`;\n }\n\n // Word boundary to avoid matching inside\n // larger numbers\n return new RegExp(`(?<!\\\\w)${pattern}(?!\\\\w)`, \"g\");\n};\n\n// ─── Grouped collections ──────────────────────\n\n/**\n * All discovered validators, lazily populated.\n * Import * from \"../src\" would pull everything;\n * instead, callers pass validators explicitly.\n */\n\n/**\n * Build patterns for a list of validators.\n */\nexport const toPatterns = <TValidator extends Validator>(\n validators: readonly TValidator[],\n): ValidatorPattern<TValidator>[] =>\n validators.map((v) => ({\n validator: v,\n regex: toRegex(v),\n }));\n\n/**\n * Filter validators by country code and build\n * patterns.\n */\ntype CountryScopedValidator<\n TValidator extends Validator,\n TCountry extends CountryCode,\n> =\n TValidator extends CountryValidator<\n infer TValidatorCountry,\n infer TParsed\n >\n ? TCountry extends TValidatorCountry\n ? TValidator & CountryValidator<TCountry, TParsed>\n : TValidatorCountry extends TCountry\n ? TValidator\n : never\n : never;\n\nexport const byCountry = <\n TCountry extends CountryCode,\n TValidator extends Validator,\n>(\n country: TCountry,\n validators: readonly TValidator[],\n): ValidatorPattern<\n CountryScopedValidator<TValidator, TCountry>\n>[] => {\n const countryValidators = validators.filter(\n (\n v,\n ): v is CountryScopedValidator<TValidator, TCountry> =>\n v.scope === \"country\" && v.country === country,\n );\n return toPatterns(countryValidators);\n};\n\n/**\n * Filter validators by entity type and build\n * patterns.\n */\nexport const byEntityType = <TValidator extends Validator>(\n entityType: \"person\" | \"company\" | \"any\",\n validators: readonly TValidator[],\n): ValidatorPattern<TValidator>[] =>\n toPatterns(\n validators.filter(\n (v) =>\n entityType === \"any\" ||\n v.entityType === entityType ||\n v.entityType === \"any\",\n ),\n );\n\n/**\n * Build patterns for ALL provided validators.\n */\nexport const allPatterns = <TValidator extends Validator>(\n validators: readonly TValidator[],\n): ValidatorPattern<TValidator>[] => toPatterns(validators);\n"],"mappings":"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"}
1
+ {"version":3,"file":"patterns.js","names":[],"sources":["../src/patterns.ts"],"sourcesContent":["import { allValidators } from \"./generated/registry\";\nimport type {\n CountryCode,\n CountryValidator,\n Validator,\n} from \"./types\";\n\nexport type ValidatorPattern<\n TValidator extends Validator = Validator,\n> = {\n validator: TValidator;\n regex: RegExp;\n};\n\nexport const toRegex = (validator: Validator): RegExp => {\n if (validator.candidatePattern === undefined) {\n throw new Error(\n `${validator.name} does not define a candidate pattern`,\n );\n }\n return new RegExp(validator.candidatePattern, \"g\");\n};\nexport const toPatterns = <TValidator extends Validator>(\n validators: readonly TValidator[],\n): ValidatorPattern<TValidator>[] =>\n validators\n .filter(\n (validator) =>\n validator.candidatePattern !== undefined,\n )\n .map((validator) => ({\n validator,\n regex: toRegex(validator),\n }));\nexport const byCountry = <TCountry extends CountryCode>(\n country: TCountry,\n) =>\n toPatterns(\n allValidators.filter(\n (validator) =>\n validator.scope === \"country\" &&\n validator.country === country,\n ) as unknown as readonly CountryValidator<TCountry>[],\n );\nexport const byEntityType = (\n entityType: Validator[\"entityType\"],\n) =>\n toPatterns(\n allValidators.filter(\n (validator) => validator.entityType === entityType,\n ),\n );\nexport const allPatterns = () => toPatterns(allValidators);\n"],"mappings":";;AAcA,MAAa,WAAW,cAAiC;CACvD,IAAI,UAAU,qBAAqB,KAAA,GACjC,MAAM,IAAI,MACR,GAAG,UAAU,KAAK,qCACpB;CAEF,OAAO,IAAI,OAAO,UAAU,kBAAkB,GAAG;AACnD;AACA,MAAa,cACX,eAEA,WACG,QACE,cACC,UAAU,qBAAqB,KAAA,CACnC,CAAC,CACA,KAAK,eAAe;CACnB;CACA,OAAO,QAAQ,SAAS;AAC1B,EAAE;AACN,MAAa,aACX,YAEA,WACE,cAAc,QACX,cACC,UAAU,UAAU,aACpB,UAAU,YAAY,OAC1B,CACF;AACF,MAAa,gBACX,eAEA,WACE,cAAc,QACX,cAAc,UAAU,eAAe,UAC1C,CACF;AACF,MAAa,oBAAoB,WAAW,aAAa"}
package/dist/pe/mod.d.ts CHANGED
@@ -1,6 +1,4 @@
1
1
  import ruc from "./ruc.js";
2
-
3
- //#region src/pe/mod.d.ts
4
2
  declare namespace mod_d_exports {
5
3
  export { ruc };
6
4
  }