stdnum 1.10.0 → 1.10.1

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 (489) hide show
  1. package/lib/cjs/no/fodselsnummer.js +2 -2
  2. package/lib/esm/no/fodselsnummer.js +2 -2
  3. package/package.json +5 -2
  4. package/src/ad/index.ts +1 -0
  5. package/src/ad/nrt.spec.ts +36 -0
  6. package/src/ad/nrt.ts +87 -0
  7. package/src/al/index.ts +1 -0
  8. package/src/al/nipt.spec.ts +43 -0
  9. package/src/al/nipt.ts +111 -0
  10. package/src/ar/cbu.spec.ts +28 -0
  11. package/src/ar/cbu.ts +96 -0
  12. package/src/ar/cuit.spec.ts +28 -0
  13. package/src/ar/cuit.ts +102 -0
  14. package/src/ar/dni.spec.ts +22 -0
  15. package/src/ar/dni.ts +72 -0
  16. package/src/ar/index.ts +3 -0
  17. package/src/at/businessid.spec.ts +34 -0
  18. package/src/at/businessid.ts +73 -0
  19. package/src/at/index.ts +4 -0
  20. package/src/at/tin.spec.ts +173 -0
  21. package/src/at/tin.ts +140 -0
  22. package/src/at/uid.spec.ts +44 -0
  23. package/src/at/uid.ts +84 -0
  24. package/src/at/vnr.spec.ts +38 -0
  25. package/src/at/vnr.ts +84 -0
  26. package/src/au/abn.spec.ts +28 -0
  27. package/src/au/abn.ts +78 -0
  28. package/src/au/acn.spec.ts +34 -0
  29. package/src/au/acn.ts +76 -0
  30. package/src/au/index.ts +3 -0
  31. package/src/au/tfn.spec.ts +28 -0
  32. package/src/au/tfn.ts +79 -0
  33. package/src/az/index.ts +2 -0
  34. package/src/az/pin.spec.ts +16 -0
  35. package/src/az/pin.ts +61 -0
  36. package/src/az/tin.spec.ts +28 -0
  37. package/src/az/tin.ts +64 -0
  38. package/src/ba/index.ts +1 -0
  39. package/src/ba/jmbg.spec.ts +28 -0
  40. package/src/ba/jmbg.ts +85 -0
  41. package/src/be/bis.spec.ts +184 -0
  42. package/src/be/bis.ts +85 -0
  43. package/src/be/index.ts +4 -0
  44. package/src/be/insz.spec.ts +51 -0
  45. package/src/be/insz.ts +55 -0
  46. package/src/be/nn.spec.ts +117 -0
  47. package/src/be/nn.ts +77 -0
  48. package/src/be/personIdentifierHelpers.spec.ts +254 -0
  49. package/src/be/personIdentifierHelpers.ts +130 -0
  50. package/src/be/vat.spec.ts +46 -0
  51. package/src/be/vat.ts +84 -0
  52. package/src/bg/egn.spec.ts +28 -0
  53. package/src/bg/egn.ts +75 -0
  54. package/src/bg/index.ts +3 -0
  55. package/src/bg/pnf.spec.ts +28 -0
  56. package/src/bg/pnf.ts +73 -0
  57. package/src/bg/vat.spec.ts +34 -0
  58. package/src/bg/vat.ts +120 -0
  59. package/src/br/cnpj.spec.ts +34 -0
  60. package/src/br/cnpj.ts +89 -0
  61. package/src/br/cpf.spec.ts +34 -0
  62. package/src/br/cpf.ts +87 -0
  63. package/src/br/index.ts +2 -0
  64. package/src/by/index.ts +1 -0
  65. package/src/by/unp.spec.ts +34 -0
  66. package/src/by/unp.ts +108 -0
  67. package/src/bz/index.ts +1 -0
  68. package/src/bz/tin.spec.ts +28 -0
  69. package/src/bz/tin.ts +67 -0
  70. package/src/ca/bn.spec.ts +40 -0
  71. package/src/ca/bn.ts +88 -0
  72. package/src/ca/gst.spec.ts +34 -0
  73. package/src/ca/gst.ts +70 -0
  74. package/src/ca/index.ts +5 -0
  75. package/src/ca/pst.spec.ts +28 -0
  76. package/src/ca/pst.ts +71 -0
  77. package/src/ca/qst.spec.ts +47 -0
  78. package/src/ca/qst.ts +88 -0
  79. package/src/ca/sin.spec.ts +34 -0
  80. package/src/ca/sin.ts +72 -0
  81. package/src/ch/index.ts +3 -0
  82. package/src/ch/ssn.spec.ts +50 -0
  83. package/src/ch/ssn.ts +74 -0
  84. package/src/ch/uid.spec.ts +34 -0
  85. package/src/ch/uid.ts +82 -0
  86. package/src/ch/vat.spec.ts +28 -0
  87. package/src/ch/vat.ts +83 -0
  88. package/src/cl/index.ts +2 -0
  89. package/src/cl/run.ts +13 -0
  90. package/src/cl/rut.spec.ts +50 -0
  91. package/src/cl/rut.ts +97 -0
  92. package/src/cn/index.ts +2 -0
  93. package/src/cn/ric.spec.ts +34 -0
  94. package/src/cn/ric.ts +86 -0
  95. package/src/cn/uscc.spec.ts +34 -0
  96. package/src/cn/uscc.ts +110 -0
  97. package/src/co/index.ts +1 -0
  98. package/src/co/nit.spec.ts +40 -0
  99. package/src/co/nit.ts +85 -0
  100. package/src/cr/cpf.spec.ts +34 -0
  101. package/src/cr/cpf.ts +93 -0
  102. package/src/cr/cpj.spec.ts +28 -0
  103. package/src/cr/cpj.ts +111 -0
  104. package/src/cr/cr.spec.ts +28 -0
  105. package/src/cr/cr.ts +75 -0
  106. package/src/cr/index.ts +3 -0
  107. package/src/cu/index.ts +1 -0
  108. package/src/cu/ni.spec.ts +34 -0
  109. package/src/cu/ni.ts +74 -0
  110. package/src/cy/index.ts +1 -0
  111. package/src/cy/vat.spec.ts +28 -0
  112. package/src/cy/vat.ts +98 -0
  113. package/src/cz/dic.spec.ts +28 -0
  114. package/src/cz/dic.ts +127 -0
  115. package/src/cz/index.ts +2 -0
  116. package/src/cz/rc.spec.ts +44 -0
  117. package/src/cz/rc.ts +95 -0
  118. package/src/de/idnr.spec.ts +34 -0
  119. package/src/de/idnr.ts +91 -0
  120. package/src/de/index.ts +6 -0
  121. package/src/de/passport.spec.ts +31 -0
  122. package/src/de/passport.ts +86 -0
  123. package/src/de/pwnr.spec.ts +62 -0
  124. package/src/de/pwnr.ts +190 -0
  125. package/src/de/stnr.spec.ts +85 -0
  126. package/src/de/stnr.ts +193 -0
  127. package/src/de/svnr.spec.ts +56 -0
  128. package/src/de/svnr.ts +158 -0
  129. package/src/de/vat.spec.ts +28 -0
  130. package/src/de/vat.ts +74 -0
  131. package/src/dk/cpr.spec.ts +34 -0
  132. package/src/dk/cpr.ts +129 -0
  133. package/src/dk/cvr.spec.ts +28 -0
  134. package/src/dk/cvr.ts +81 -0
  135. package/src/dk/index.ts +2 -0
  136. package/src/do/cedula.spec.ts +34 -0
  137. package/src/do/cedula.ts +67 -0
  138. package/src/do/index.ts +3 -0
  139. package/src/do/ncf.spec.ts +34 -0
  140. package/src/do/ncf.ts +133 -0
  141. package/src/do/rnc.spec.ts +40 -0
  142. package/src/do/rnc.ts +74 -0
  143. package/src/dz/index.ts +1 -0
  144. package/src/dz/nif.spec.ts +39 -0
  145. package/src/dz/nif.ts +80 -0
  146. package/src/ec/ci.spec.ts +28 -0
  147. package/src/ec/ci.ts +92 -0
  148. package/src/ec/index.ts +2 -0
  149. package/src/ec/ruc.spec.ts +37 -0
  150. package/src/ec/ruc.ts +117 -0
  151. package/src/ee/ik.spec.ts +28 -0
  152. package/src/ee/ik.ts +114 -0
  153. package/src/ee/index.ts +3 -0
  154. package/src/ee/kmkr.spec.ts +28 -0
  155. package/src/ee/kmkr.ts +76 -0
  156. package/src/ee/registrikood.spec.ts +28 -0
  157. package/src/ee/registrikood.ts +80 -0
  158. package/src/eg/index.ts +1 -0
  159. package/src/eg/tn.spec.ts +44 -0
  160. package/src/eg/tn.ts +96 -0
  161. package/src/es/cif.spec.ts +43 -0
  162. package/src/es/cif.ts +84 -0
  163. package/src/es/dni.spec.ts +28 -0
  164. package/src/es/dni.ts +83 -0
  165. package/src/es/index.ts +5 -0
  166. package/src/es/nie.spec.ts +28 -0
  167. package/src/es/nie.ts +79 -0
  168. package/src/es/nif.spec.ts +52 -0
  169. package/src/es/nif.ts +95 -0
  170. package/src/es/nss.spec.ts +28 -0
  171. package/src/es/nss.ts +132 -0
  172. package/src/exceptions.ts +66 -0
  173. package/src/fi/alv.spec.ts +28 -0
  174. package/src/fi/alv.ts +76 -0
  175. package/src/fi/hetu.spec.ts +37 -0
  176. package/src/fi/hetu.ts +108 -0
  177. package/src/fi/index.ts +3 -0
  178. package/src/fi/ytunnus.spec.ts +28 -0
  179. package/src/fi/ytunnus.ts +49 -0
  180. package/src/fo/index.ts +1 -0
  181. package/src/fo/vn.spec.ts +34 -0
  182. package/src/fo/vn.ts +71 -0
  183. package/src/fr/index.ts +5 -0
  184. package/src/fr/nif.spec.ts +34 -0
  185. package/src/fr/nif.ts +82 -0
  186. package/src/fr/nir.spec.ts +36 -0
  187. package/src/fr/nir.ts +98 -0
  188. package/src/fr/siren.spec.ts +28 -0
  189. package/src/fr/siren.ts +68 -0
  190. package/src/fr/siret.spec.ts +38 -0
  191. package/src/fr/siret.ts +79 -0
  192. package/src/fr/tva.spec.ts +40 -0
  193. package/src/fr/tva.ts +125 -0
  194. package/src/gb/index.ts +3 -0
  195. package/src/gb/nino-prefixes.ts +245 -0
  196. package/src/gb/nino.spec.ts +80 -0
  197. package/src/gb/nino.ts +80 -0
  198. package/src/gb/utr.spec.ts +28 -0
  199. package/src/gb/utr.ts +76 -0
  200. package/src/gb/vat.spec.ts +40 -0
  201. package/src/gb/vat.ts +112 -0
  202. package/src/gen/ean.spec.ts +34 -0
  203. package/src/gen/ean.ts +71 -0
  204. package/src/gen/index.ts +1 -0
  205. package/src/gh/index.ts +1 -0
  206. package/src/gh/tin.spec.ts +42 -0
  207. package/src/gh/tin.ts +93 -0
  208. package/src/gn/index.ts +1 -0
  209. package/src/gn/nifp.spec.ts +40 -0
  210. package/src/gn/nifp.ts +72 -0
  211. package/src/gr/amka.spec.ts +28 -0
  212. package/src/gr/amka.ts +76 -0
  213. package/src/gr/index.ts +2 -0
  214. package/src/gr/vat.spec.ts +34 -0
  215. package/src/gr/vat.ts +84 -0
  216. package/src/gt/cui.spec.ts +34 -0
  217. package/src/gt/cui.ts +110 -0
  218. package/src/gt/index.ts +2 -0
  219. package/src/gt/nit.spec.ts +34 -0
  220. package/src/gt/nit.ts +86 -0
  221. package/src/hk/hkid.spec.ts +52 -0
  222. package/src/hk/hkid.ts +90 -0
  223. package/src/hk/index.ts +1 -0
  224. package/src/hr/index.ts +1 -0
  225. package/src/hr/oib.spec.ts +28 -0
  226. package/src/hr/oib.ts +67 -0
  227. package/src/hu/anum.spec.ts +28 -0
  228. package/src/hu/anum.ts +71 -0
  229. package/src/hu/index.ts +1 -0
  230. package/src/id/index.ts +1 -0
  231. package/src/id/npwp.spec.ts +34 -0
  232. package/src/id/npwp.ts +116 -0
  233. package/src/ie/index.ts +2 -0
  234. package/src/ie/pps.spec.ts +58 -0
  235. package/src/ie/pps.ts +81 -0
  236. package/src/ie/vat.spec.ts +40 -0
  237. package/src/ie/vat.ts +99 -0
  238. package/src/il/hp.spec.ts +38 -0
  239. package/src/il/hp.ts +75 -0
  240. package/src/il/idnr.spec.ts +28 -0
  241. package/src/il/idnr.ts +70 -0
  242. package/src/il/index.ts +2 -0
  243. package/src/in/aadhaar.spec.ts +40 -0
  244. package/src/in/aadhaar.ts +85 -0
  245. package/src/in/epic.spec.ts +34 -0
  246. package/src/in/epic.ts +85 -0
  247. package/src/in/gstin.spec.ts +34 -0
  248. package/src/in/gstin.ts +156 -0
  249. package/src/in/index.ts +4 -0
  250. package/src/in/pan.spec.ts +40 -0
  251. package/src/in/pan.ts +93 -0
  252. package/src/index.ts +404 -0
  253. package/src/is/index.ts +2 -0
  254. package/src/is/kennitala.spec.ts +46 -0
  255. package/src/is/kennitala.ts +80 -0
  256. package/src/is/vsk.spec.ts +22 -0
  257. package/src/is/vsk.ts +60 -0
  258. package/src/it/aic.spec.ts +40 -0
  259. package/src/it/aic.ts +97 -0
  260. package/src/it/codicefiscale.spec.ts +28 -0
  261. package/src/it/codicefiscale.ts +167 -0
  262. package/src/it/index.ts +3 -0
  263. package/src/it/iva.spec.ts +28 -0
  264. package/src/it/iva.ts +65 -0
  265. package/src/jp/cn.spec.ts +28 -0
  266. package/src/jp/cn.ts +77 -0
  267. package/src/jp/index.ts +1 -0
  268. package/src/ke/index.ts +1 -0
  269. package/src/ke/pin.spec.ts +34 -0
  270. package/src/ke/pin.ts +77 -0
  271. package/src/kr/brn.spec.ts +28 -0
  272. package/src/kr/brn.ts +91 -0
  273. package/src/kr/index.ts +2 -0
  274. package/src/kr/rrn.spec.ts +34 -0
  275. package/src/kr/rrn.ts +104 -0
  276. package/src/li/index.ts +1 -0
  277. package/src/li/peid.spec.ts +22 -0
  278. package/src/li/peid.ts +71 -0
  279. package/src/lt/asmens.spec.ts +28 -0
  280. package/src/lt/asmens.ts +73 -0
  281. package/src/lt/index.ts +2 -0
  282. package/src/lt/pvm.spec.ts +34 -0
  283. package/src/lt/pvm.ts +75 -0
  284. package/src/lu/index.ts +1 -0
  285. package/src/lu/tva.spec.ts +28 -0
  286. package/src/lu/tva.ts +70 -0
  287. package/src/lv/index.ts +1 -0
  288. package/src/lv/pvn.spec.ts +44 -0
  289. package/src/lv/pvn.ts +102 -0
  290. package/src/ma/ice.spec.ts +39 -0
  291. package/src/ma/ice.ts +72 -0
  292. package/src/ma/ice9.spec.ts +28 -0
  293. package/src/ma/ice9.ts +62 -0
  294. package/src/ma/index.ts +2 -0
  295. package/src/mc/index.ts +1 -0
  296. package/src/mc/tva.spec.ts +28 -0
  297. package/src/mc/tva.ts +67 -0
  298. package/src/md/idno.spec.ts +28 -0
  299. package/src/md/idno.ts +78 -0
  300. package/src/md/index.ts +1 -0
  301. package/src/me/index.ts +2 -0
  302. package/src/me/jmbg.ts +17 -0
  303. package/src/me/pib.spec.ts +158 -0
  304. package/src/me/pib.ts +77 -0
  305. package/src/mk/edb.spec.ts +50 -0
  306. package/src/mk/edb.ts +88 -0
  307. package/src/mk/index.ts +2 -0
  308. package/src/mk/jmbg.ts +17 -0
  309. package/src/mt/index.ts +1 -0
  310. package/src/mt/vat.spec.ts +28 -0
  311. package/src/mt/vat.ts +69 -0
  312. package/src/mu/index.ts +1 -0
  313. package/src/mu/nid.spec.ts +34 -0
  314. package/src/mu/nid.ts +89 -0
  315. package/src/mx/banks.ts +658 -0
  316. package/src/mx/clabe.spec.ts +68 -0
  317. package/src/mx/clabe.ts +105 -0
  318. package/src/mx/curp.spec.ts +28 -0
  319. package/src/mx/curp.ts +261 -0
  320. package/src/mx/index.ts +3 -0
  321. package/src/mx/rfc.spec.ts +69 -0
  322. package/src/mx/rfc.ts +193 -0
  323. package/src/my/index.ts +1 -0
  324. package/src/my/nric.spec.ts +40 -0
  325. package/src/my/nric.ts +91 -0
  326. package/src/nl/bsn.spec.ts +68 -0
  327. package/src/nl/bsn.ts +81 -0
  328. package/src/nl/btw.spec.ts +40 -0
  329. package/src/nl/btw.ts +95 -0
  330. package/src/nl/index.ts +3 -0
  331. package/src/nl/onderwijsnummer.spec.ts +34 -0
  332. package/src/nl/onderwijsnummer.ts +77 -0
  333. package/src/no/fodselsnummer.spec.ts +56 -0
  334. package/src/no/fodselsnummer.ts +118 -0
  335. package/src/no/index.ts +4 -0
  336. package/src/no/kontonr.spec.ts +34 -0
  337. package/src/no/kontonr.ts +84 -0
  338. package/src/no/mva.spec.ts +28 -0
  339. package/src/no/mva.ts +80 -0
  340. package/src/no/orgnr.spec.ts +28 -0
  341. package/src/no/orgnr.ts +75 -0
  342. package/src/nz/bank.spec.ts +28 -0
  343. package/src/nz/bank.ts +238 -0
  344. package/src/nz/index.ts +2 -0
  345. package/src/nz/ird.spec.ts +34 -0
  346. package/src/nz/ird.ts +102 -0
  347. package/src/pe/ce.spec.ts +46 -0
  348. package/src/pe/ce.ts +61 -0
  349. package/src/pe/cui.spec.ts +28 -0
  350. package/src/pe/cui.ts +85 -0
  351. package/src/pe/index.ts +3 -0
  352. package/src/pe/ruc.spec.ts +46 -0
  353. package/src/pe/ruc.ts +84 -0
  354. package/src/pk/cnic.spec.ts +34 -0
  355. package/src/pk/cnic.ts +97 -0
  356. package/src/pk/index.ts +2 -0
  357. package/src/pk/ntn.spec.ts +22 -0
  358. package/src/pk/ntn.ts +65 -0
  359. package/src/pl/index.ts +3 -0
  360. package/src/pl/nip.spec.ts +34 -0
  361. package/src/pl/nip.ts +74 -0
  362. package/src/pl/pesel.spec.ts +34 -0
  363. package/src/pl/pesel.ts +97 -0
  364. package/src/pl/regon.spec.ts +52 -0
  365. package/src/pl/regon.ts +88 -0
  366. package/src/pt/cc.spec.ts +43 -0
  367. package/src/pt/cc.ts +74 -0
  368. package/src/pt/index.ts +3 -0
  369. package/src/pt/nif.spec.ts +28 -0
  370. package/src/pt/nif.ts +78 -0
  371. package/src/pt/nipc.ts +27 -0
  372. package/src/py/cedula.spec.ts +46 -0
  373. package/src/py/cedula.ts +73 -0
  374. package/src/py/index.ts +2 -0
  375. package/src/py/ruc.spec.ts +40 -0
  376. package/src/py/ruc.ts +93 -0
  377. package/src/ro/cif.spec.ts +40 -0
  378. package/src/ro/cif.ts +62 -0
  379. package/src/ro/cnp.spec.ts +50 -0
  380. package/src/ro/cnp.ts +158 -0
  381. package/src/ro/cui.spec.ts +28 -0
  382. package/src/ro/cui.ts +83 -0
  383. package/src/ro/index.ts +4 -0
  384. package/src/ro/onrc.spec.ts +28 -0
  385. package/src/ro/onrc.ts +109 -0
  386. package/src/rs/index.ts +2 -0
  387. package/src/rs/jmbg.ts +16 -0
  388. package/src/rs/pib.spec.ts +28 -0
  389. package/src/rs/pib.ts +69 -0
  390. package/src/ru/index.ts +1 -0
  391. package/src/ru/inn.spec.ts +32 -0
  392. package/src/ru/inn.ts +106 -0
  393. package/src/se/index.ts +3 -0
  394. package/src/se/orgnr.spec.ts +28 -0
  395. package/src/se/orgnr.ts +68 -0
  396. package/src/se/personnummer.spec.ts +45 -0
  397. package/src/se/personnummer.ts +143 -0
  398. package/src/se/vat.spec.ts +28 -0
  399. package/src/se/vat.ts +73 -0
  400. package/src/sg/index.ts +1 -0
  401. package/src/sg/uen.spec.ts +46 -0
  402. package/src/sg/uen.ts +209 -0
  403. package/src/si/ddv.spec.ts +28 -0
  404. package/src/si/ddv.ts +76 -0
  405. package/src/si/emso.spec.ts +15 -0
  406. package/src/si/emso.ts +27 -0
  407. package/src/si/index.ts +3 -0
  408. package/src/si/jmbg.ts +20 -0
  409. package/src/sk/dph.spec.ts +28 -0
  410. package/src/sk/dph.ts +71 -0
  411. package/src/sk/index.ts +2 -0
  412. package/src/sk/rc.ts +12 -0
  413. package/src/sm/coe.spec.ts +34 -0
  414. package/src/sm/coe.ts +80 -0
  415. package/src/sm/index.ts +1 -0
  416. package/src/sv/index.ts +1 -0
  417. package/src/sv/nit.spec.ts +34 -0
  418. package/src/sv/nit.ts +117 -0
  419. package/src/th/idnr.spec.ts +41 -0
  420. package/src/th/idnr.ts +80 -0
  421. package/src/th/index.ts +3 -0
  422. package/src/th/moa.spec.ts +62 -0
  423. package/src/th/moa.ts +85 -0
  424. package/src/th/tin.spec.ts +77 -0
  425. package/src/th/tin.ts +56 -0
  426. package/src/tn/index.ts +1 -0
  427. package/src/tn/mf.spec.ts +37 -0
  428. package/src/tn/mf.ts +169 -0
  429. package/src/tr/index.ts +2 -0
  430. package/src/tr/tckimlik.spec.ts +40 -0
  431. package/src/tr/tckimlik.ts +87 -0
  432. package/src/tr/vkn.spec.ts +28 -0
  433. package/src/tr/vkn.ts +87 -0
  434. package/src/tw/ban.spec.ts +28 -0
  435. package/src/tw/ban.ts +67 -0
  436. package/src/tw/index.ts +5 -0
  437. package/src/tw/natid.spec.ts +28 -0
  438. package/src/tw/natid.ts +105 -0
  439. package/src/tw/tax_code.spec.ts +34 -0
  440. package/src/tw/tax_code.ts +98 -0
  441. package/src/tw/ubn.spec.ts +28 -0
  442. package/src/tw/ubn.ts +80 -0
  443. package/src/tw/ui.spec.ts +38 -0
  444. package/src/tw/ui.ts +107 -0
  445. package/src/types.ts +82 -0
  446. package/src/ua/edrpou.spec.ts +28 -0
  447. package/src/ua/edrpou.ts +88 -0
  448. package/src/ua/index.ts +2 -0
  449. package/src/ua/rntrc.spec.ts +28 -0
  450. package/src/ua/rntrc.ts +77 -0
  451. package/src/us/ein.spec.ts +28 -0
  452. package/src/us/ein.ts +179 -0
  453. package/src/us/index.ts +2 -0
  454. package/src/us/ssn.spec.ts +28 -0
  455. package/src/us/ssn.ts +117 -0
  456. package/src/util/checksum.spec.ts +70 -0
  457. package/src/util/checksum.ts +258 -0
  458. package/src/util/index.ts +13 -0
  459. package/src/util/isValidDate.spec.ts +49 -0
  460. package/src/util/isValidDate.ts +87 -0
  461. package/src/util/iso7064.spec.ts +17 -0
  462. package/src/util/iso7064.ts +8 -0
  463. package/src/util/pymod.ts +8 -0
  464. package/src/util/strings/char.ts +18 -0
  465. package/src/util/strings/clean.spec.ts +15 -0
  466. package/src/util/strings/clean.ts +305 -0
  467. package/src/util/strings/format.ts +18 -0
  468. package/src/util/strings/index.ts +5 -0
  469. package/src/util/strings/reverseString.ts +3 -0
  470. package/src/util/strings/splitAt.spec.ts +15 -0
  471. package/src/util/strings/splitAt.ts +16 -0
  472. package/src/uy/cedula.spec.ts +28 -0
  473. package/src/uy/cedula.ts +74 -0
  474. package/src/uy/index.ts +3 -0
  475. package/src/uy/nie.spec.ts +28 -0
  476. package/src/uy/nie.ts +84 -0
  477. package/src/uy/rut.spec.ts +34 -0
  478. package/src/uy/rut.ts +99 -0
  479. package/src/ve/index.ts +1 -0
  480. package/src/ve/rif.spec.ts +38 -0
  481. package/src/ve/rif.ts +92 -0
  482. package/src/vn/index.ts +1 -0
  483. package/src/vn/mst.spec.ts +40 -0
  484. package/src/vn/mst.ts +100 -0
  485. package/src/za/idnr.spec.ts +28 -0
  486. package/src/za/idnr.ts +84 -0
  487. package/src/za/index.ts +2 -0
  488. package/src/za/tin.spec.ts +28 -0
  489. package/src/za/tin.ts +75 -0
package/src/il/hp.ts ADDED
@@ -0,0 +1,75 @@
1
+ /**
2
+ * Company Number (מספר חברה, or short ח.פ. Israeli company number).
3
+ *
4
+ * It consists of nine digits and includes a check digit. For companies
5
+ * the first digit is a 5. The first two digits identify the type of
6
+ * company.
7
+ *
8
+ * Source
9
+ * https://he.wikipedia.org/wiki/תאגיד#מספר_רישום_התאגיד
10
+ * https://www.oecd.org/tax/automatic-exchange/crs-implementation-and-assistance/tax-identification-numbers/Israel-TIN.pdf
11
+ * https://wiki.scn.sap.com/wiki/display/CRM/Israel
12
+ *
13
+ * Entity
14
+ */
15
+
16
+ import * as exceptions from '../exceptions';
17
+ import { strings } from '../util';
18
+ import { Validator, ValidateReturn } from '../types';
19
+ import { luhnChecksumValidate } from '../util/checksum';
20
+
21
+ function clean(input: string): ReturnType<typeof strings.cleanUnicode> {
22
+ return strings.cleanUnicode(input, ' -');
23
+ }
24
+
25
+ const impl: Validator = {
26
+ name: 'Israeli Company Number',
27
+ localName: 'מספר חברה',
28
+ abbreviation: 'ח.פ.',
29
+ compact(input: string): string {
30
+ const [value, err] = clean(input);
31
+
32
+ if (err) {
33
+ throw err;
34
+ }
35
+
36
+ return value;
37
+ },
38
+
39
+ format(input: string): string {
40
+ const [value] = clean(input);
41
+
42
+ return value;
43
+ },
44
+
45
+ validate(input: string): ValidateReturn {
46
+ const [value, error] = clean(input);
47
+
48
+ if (error) {
49
+ return { isValid: false, error };
50
+ }
51
+ if (value.length !== 9) {
52
+ return { isValid: false, error: new exceptions.InvalidLength() };
53
+ }
54
+ if (!strings.isdigits(value)) {
55
+ return { isValid: false, error: new exceptions.InvalidFormat() };
56
+ }
57
+ if (value[0] !== '5') {
58
+ return { isValid: false, error: new exceptions.InvalidComponent() };
59
+ }
60
+
61
+ if (!luhnChecksumValidate(value)) {
62
+ return { isValid: false, error: new exceptions.InvalidChecksum() };
63
+ }
64
+
65
+ return {
66
+ isValid: true,
67
+ compact: value,
68
+ isIndividual: false,
69
+ isCompany: true,
70
+ };
71
+ },
72
+ };
73
+
74
+ export const { name, localName, abbreviation, validate, format, compact } =
75
+ impl;
@@ -0,0 +1,28 @@
1
+ import { validate, format } from './idnr';
2
+ import { InvalidLength, InvalidChecksum } from '../exceptions';
3
+
4
+ describe('il/idnr', () => {
5
+ it('format:39337423', () => {
6
+ const result = format('39337423');
7
+
8
+ expect(result).toEqual('3933742-3');
9
+ });
10
+
11
+ it('validate:3933742-3', () => {
12
+ const result = validate('3933742-3');
13
+
14
+ expect(result.isValid && result.compact).toEqual('39337423');
15
+ });
16
+
17
+ it('validate:3933742999', () => {
18
+ const result = validate('3933742999');
19
+
20
+ expect(result.error).toBeInstanceOf(InvalidLength);
21
+ });
22
+
23
+ it('validate:3933742-2', () => {
24
+ const result = validate('3933742-2');
25
+
26
+ expect(result.error).toBeInstanceOf(InvalidChecksum);
27
+ });
28
+ });
package/src/il/idnr.ts ADDED
@@ -0,0 +1,70 @@
1
+ /**
2
+ * Identity Number (Mispar Zehut, מספר זהות, Israeli identity number).
3
+ *
4
+ * The identity number (Mispar Zehut, מספר זהות) is issued at birth to Israeli
5
+ * citizens. The number consists of nine digits and includes a check digit.
6
+
7
+ * Source
8
+ * https://en.wikipedia.org/wiki/National_identification_number#Israel
9
+ * https://en.wikipedia.org/wiki/Israeli_identity_card
10
+ * https://he.wikipedia.org/wiki/מספר_זהות_(ישראל)
11
+ *
12
+ * PERSON
13
+ */
14
+
15
+ import * as exceptions from '../exceptions';
16
+ import { strings } from '../util';
17
+ import { Validator, ValidateReturn } from '../types';
18
+ import { luhnChecksumValidate } from '../util/checksum';
19
+
20
+ function clean(input: string): ReturnType<typeof strings.cleanUnicode> {
21
+ return strings.cleanUnicode(input, ' -');
22
+ }
23
+
24
+ const impl: Validator = {
25
+ name: 'Israeli Identify Number',
26
+ localName: 'Mispar Zehut, מספר זהות',
27
+ compact(input: string): string {
28
+ const [value, err] = clean(input);
29
+
30
+ if (err) {
31
+ throw err;
32
+ }
33
+
34
+ return value;
35
+ },
36
+
37
+ format(input: string): string {
38
+ const [value] = clean(input);
39
+
40
+ return strings.splitAt(value, -1).join('-');
41
+ },
42
+
43
+ validate(input: string): ValidateReturn {
44
+ const [value, error] = clean(input);
45
+
46
+ if (error) {
47
+ return { isValid: false, error };
48
+ }
49
+ if (value.length > 9) {
50
+ return { isValid: false, error: new exceptions.InvalidLength() };
51
+ }
52
+ if (!strings.isdigits(value)) {
53
+ return { isValid: false, error: new exceptions.InvalidFormat() };
54
+ }
55
+
56
+ if (!luhnChecksumValidate(value.padStart(9, '0'))) {
57
+ return { isValid: false, error: new exceptions.InvalidChecksum() };
58
+ }
59
+
60
+ return {
61
+ isValid: true,
62
+ compact: value,
63
+ isIndividual: true,
64
+ isCompany: false,
65
+ };
66
+ },
67
+ };
68
+
69
+ export const { name, localName, abbreviation, validate, format, compact } =
70
+ impl;
@@ -0,0 +1,2 @@
1
+ export * as hp from './hp';
2
+ export * as idnr from './idnr';
@@ -0,0 +1,40 @@
1
+ import { validate, format } from './aadhaar';
2
+ import { InvalidLength, InvalidChecksum, InvalidFormat } from '../exceptions';
3
+
4
+ describe('in/aadhaar', () => {
5
+ it('format:234123412346', () => {
6
+ const result = format('234123412346');
7
+
8
+ expect(result).toEqual('2341 2341 2346');
9
+ });
10
+
11
+ it('validate:234123412346', () => {
12
+ const result = validate('234123412346');
13
+
14
+ expect(result.isValid && result.compact).toEqual('234123412346');
15
+ });
16
+
17
+ it('validate:123412341234', () => {
18
+ const result = validate('123412341234');
19
+
20
+ expect(result.error).toBeInstanceOf(InvalidFormat);
21
+ });
22
+
23
+ it('validate:222222222222', () => {
24
+ const result = validate('222222222222');
25
+
26
+ expect(result.error).toBeInstanceOf(InvalidFormat);
27
+ });
28
+
29
+ it('validate:12345678', () => {
30
+ const result = validate('12345678');
31
+
32
+ expect(result.error).toBeInstanceOf(InvalidLength);
33
+ });
34
+
35
+ it('validate:234123412347', () => {
36
+ const result = validate('234123412347');
37
+
38
+ expect(result.error).toBeInstanceOf(InvalidChecksum);
39
+ });
40
+ });
@@ -0,0 +1,85 @@
1
+ /**
2
+ * Aadhaar (Indian digital resident personal identity number)
3
+ *
4
+ * Aadhaar is a 12 digit identification number that can be obtained by Indian
5
+ * citizens, non-residents passport holders of India and resident foreign
6
+ * nationals. The number is issued by the Unique Identification Authority of
7
+ * India (UIDAI).
8
+ *
9
+ * Aadhaar is made up of 12 digits where the last digits is a check digit
10
+ * calculated using the Verhoeff algorithm. The numbers are generated in a
11
+ * random, non-repeating sequence and do not begin with 0 or 1.
12
+ *
13
+ * Aadhaar is a 12 digit unique identity number issued to all Indian residents.
14
+ * The number is assigned by the Unique Identification Authority of India
15
+ * (UIDAI).
16
+ *
17
+ * Source
18
+ * https://web.archive.org/web/20140611025606/http://uidai.gov.in/UID_PDF/Working_Papers/A_UID_Numbering_Scheme.pdf
19
+ * https://en.wikipedia.org/wiki/Aadhaar
20
+ *
21
+ * PERSON
22
+ */
23
+
24
+ import * as exceptions from '../exceptions';
25
+ import { strings } from '../util';
26
+ import { Validator, ValidateReturn } from '../types';
27
+ import { verhoeffValidate } from '../util/checksum';
28
+
29
+ function clean(input: string): ReturnType<typeof strings.cleanUnicode> {
30
+ return strings.cleanUnicode(input, ' -');
31
+ }
32
+
33
+ const impl: Validator = {
34
+ name: 'Indian Digital Resident Personal Identity Number',
35
+ localName: 'Aadhaar',
36
+ compact(input: string): string {
37
+ const [value, err] = clean(input);
38
+
39
+ if (err) {
40
+ throw err;
41
+ }
42
+
43
+ return value;
44
+ },
45
+
46
+ format(input: string): string {
47
+ const [value] = clean(input);
48
+
49
+ return strings.splitAt(value, 4, 8).join(' ');
50
+ },
51
+
52
+ validate(input: string): ValidateReturn {
53
+ const [value, error] = clean(input);
54
+
55
+ if (error) {
56
+ return { isValid: false, error };
57
+ }
58
+ if (value.length !== 12) {
59
+ return { isValid: false, error: new exceptions.InvalidLength() };
60
+ }
61
+ if (!strings.isdigits(value)) {
62
+ return { isValid: false, error: new exceptions.InvalidFormat() };
63
+ }
64
+ if (value[0] === '0' || value[0] === '1') {
65
+ return { isValid: false, error: new exceptions.InvalidFormat() };
66
+ }
67
+ if (value.split('').reverse().join('') === value) {
68
+ return { isValid: false, error: new exceptions.InvalidFormat() };
69
+ }
70
+
71
+ if (!verhoeffValidate(value)) {
72
+ return { isValid: false, error: new exceptions.InvalidChecksum() };
73
+ }
74
+
75
+ return {
76
+ isValid: true,
77
+ compact: value,
78
+ isIndividual: true,
79
+ isCompany: false,
80
+ };
81
+ },
82
+ };
83
+
84
+ export const { name, localName, abbreviation, validate, format, compact } =
85
+ impl;
@@ -0,0 +1,34 @@
1
+ import { validate, format } from './epic';
2
+ import { InvalidLength, InvalidChecksum } from '../exceptions';
3
+
4
+ describe('in/epic', () => {
5
+ it('format:WKH1186253', () => {
6
+ const result = format('WKH1186253');
7
+
8
+ expect(result).toEqual('WKH1186253');
9
+ });
10
+
11
+ it('fvalidate:WKH1186253', () => {
12
+ const result = validate('WKH1186253');
13
+
14
+ expect(result.isValid && result.compact).toEqual('WKH1186253');
15
+ });
16
+
17
+ test.each(['WKH1186253'])('validate:%s', value => {
18
+ const result = validate(value);
19
+
20
+ expect(result.isValid).toEqual(true);
21
+ });
22
+
23
+ it('validate:WKH118625', () => {
24
+ const result = validate('WKH118625');
25
+
26
+ expect(result.error).toBeInstanceOf(InvalidLength);
27
+ });
28
+
29
+ it('validate:WKH1186254', () => {
30
+ const result = validate('WKH1186254');
31
+
32
+ expect(result.error).toBeInstanceOf(InvalidChecksum);
33
+ });
34
+ });
package/src/in/epic.ts ADDED
@@ -0,0 +1,85 @@
1
+ /**
2
+ * EPIC (Electoral Photo Identity Card, Indian Voter ID).
3
+ *
4
+ * The Electoral Photo Identity Card (EPIC) is an identity document issued by
5
+ * the Election Commission of India (ECI) only to the India citizens who have
6
+ * reached the age of 18.
7
+ *
8
+ * Each EPIC contains an unique 10 digit alphanumeric identifier known as EPIC
9
+ * number or Voter ID number.
10
+ *
11
+ * Every EPIC number begins with a Functional Unique Serial Number (FUSN), a 3
12
+ * letter unique identifier for each Assembly Constituency. FUSN is followed by
13
+ * a 6 digit serial number and 1 check digit of the serial number calculated
14
+ * using Luhn algorithm.
15
+ *
16
+ * Source
17
+ * https://en.wikipedia.org/wiki/Voter_ID_(India)
18
+ * https://www.kotaksecurities.com/ksweb/voter-id/serial-number-in-elctoral-roll
19
+ *
20
+ * PERSON
21
+ */
22
+
23
+ import * as exceptions from '../exceptions';
24
+ import { strings } from '../util';
25
+ import { Validator, ValidateReturn } from '../types';
26
+ import { luhnChecksumValidate } from '../util/checksum';
27
+
28
+ function clean(input: string): ReturnType<typeof strings.cleanUnicode> {
29
+ return strings.cleanUnicode(input, ' -');
30
+ }
31
+
32
+ const validRe = /^[A-Z]{3}[0-9]{7}$/;
33
+
34
+ const impl: Validator = {
35
+ name: 'Electoral Photo Identity Card',
36
+ localName: '',
37
+ abbreviation: 'EPIC',
38
+
39
+ compact(input: string): string {
40
+ const [value, err] = clean(input);
41
+
42
+ if (err) {
43
+ throw err;
44
+ }
45
+
46
+ return value;
47
+ },
48
+
49
+ format(input: string): string {
50
+ const [value] = clean(input);
51
+
52
+ return value;
53
+ },
54
+
55
+ validate(input: string): ValidateReturn {
56
+ const [value, error] = clean(input);
57
+
58
+ if (error) {
59
+ return { isValid: false, error };
60
+ }
61
+ if (value.length !== 10) {
62
+ return { isValid: false, error: new exceptions.InvalidLength() };
63
+ }
64
+
65
+ if (!validRe.test(value)) {
66
+ return { isValid: false, error: new exceptions.InvalidFormat() };
67
+ }
68
+
69
+ const [, front] = strings.splitAt(value, 3);
70
+
71
+ if (!luhnChecksumValidate(front)) {
72
+ return { isValid: false, error: new exceptions.InvalidChecksum() };
73
+ }
74
+
75
+ return {
76
+ isValid: true,
77
+ compact: value,
78
+ isIndividual: true,
79
+ isCompany: false,
80
+ };
81
+ },
82
+ };
83
+
84
+ export const { name, localName, abbreviation, validate, format, compact } =
85
+ impl;
@@ -0,0 +1,34 @@
1
+ import { validate, format } from './gstin';
2
+ import { InvalidLength, InvalidChecksum } from '../exceptions';
3
+
4
+ describe('in/gstin', () => {
5
+ it('format:27AAPFU0939F1ZV', () => {
6
+ const result = format('27AAPFU0939F1ZV');
7
+
8
+ expect(result).toEqual('27AAPFU0939F1ZV');
9
+ });
10
+
11
+ it('fvalidate:27AAPFU0939F1ZV', () => {
12
+ const result = validate('27AAPFU0939F1ZV');
13
+
14
+ expect(result.isValid && result.compact).toEqual('27AAPFU0939F1ZV');
15
+ });
16
+
17
+ test.each(['27AAPFU0939F1ZV', '29AAGCB7383J1Z4'])('validate:%s', value => {
18
+ const result = validate(value);
19
+
20
+ expect(result.isValid).toEqual(true);
21
+ });
22
+
23
+ it('validate:27AAPFU0939F1Z', () => {
24
+ const result = validate('27AAPFU0939F1Z');
25
+
26
+ expect(result.error).toBeInstanceOf(InvalidLength);
27
+ });
28
+
29
+ it('validate:27AAPFU0939F1Z0', () => {
30
+ const result = validate('27AAPFU0939F1Z0');
31
+
32
+ expect(result.error).toBeInstanceOf(InvalidChecksum);
33
+ });
34
+ });
@@ -0,0 +1,156 @@
1
+ /**
2
+ * GSTIN (Goods and Services Tax identification number, Indian VAT number).
3
+ *
4
+ * The Goods and Services Tax identification number (GSTIN) is a 15 digit unique
5
+ * identifier assigned to all business entities in India registered under the
6
+ * Goods and Services Tax (GST) Act, 2017.
7
+ *
8
+ * Each GSTIN begins with a 2 digit state code, the next 10 characters are the
9
+ * holder's PAN, the 13th character is an alphanumeric digit that represents the
10
+ * number of GSTIN registrations made in a state or union territory for same the
11
+ * PAN, the 14th character is 'Z' and the last character is an alphanumeric
12
+ * check digit calculated using Luhn mod 36 algorithm.
13
+ *
14
+ * DESCRIPTION
15
+ *
16
+ * Source
17
+ * https://bajajfinserv.in/insights/what-is-goods-and-service-tax-identification-number
18
+ * https://ddvat.gov.in/docs/List%20of%20State%20Code.pdf
19
+ * https://en.wikipedia.org/wiki/Goods_and_Services_Tax_(India)
20
+ *
21
+ * ENTITY
22
+ */
23
+
24
+ import * as exceptions from '../exceptions';
25
+ import { strings } from '../util';
26
+ import { Validator, ValidateReturn } from '../types';
27
+ import { validate as panValidate } from './pan';
28
+
29
+ function clean(input: string): ReturnType<typeof strings.cleanUnicode> {
30
+ return strings.cleanUnicode(input, ' -');
31
+ }
32
+
33
+ const validRe = /^[0-9]{2}[A-Z]{5}[0-9]{4}[A-Z][0-9A-Z]{3}$/;
34
+
35
+ const ALPHABET = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ';
36
+
37
+ const STATE_CODES: Record<string, string> = {
38
+ '01': 'Jammu and Kashmir',
39
+ '02': 'Himachal Pradesh',
40
+ '03': 'Punjab',
41
+ '04': 'Chandigarh',
42
+ '05': 'Uttarakhand',
43
+ '06': 'Haryana',
44
+ '07': 'Delhi',
45
+ '08': 'Rajasthan',
46
+ '09': 'Uttar Pradesh',
47
+ '10': 'Bihar',
48
+ '11': 'Sikkim',
49
+ '12': 'Arunachal Pradesh',
50
+ '13': 'Nagaland',
51
+ '14': 'Manipur',
52
+ '15': 'Mizoram',
53
+ '16': 'Tripura',
54
+ '17': 'Meghalaya',
55
+ '18': 'Assam',
56
+ '19': 'West Bengal',
57
+ '20': 'Jharkhand',
58
+ '21': 'Orissa',
59
+ '22': 'Chattisgarh',
60
+ '23': 'Madhya Pradesh',
61
+ '24': 'Gujarat',
62
+ '25': 'Daman and Diu',
63
+ '26': 'Dadar and Nagar Haveli',
64
+ '27': 'Maharashtra',
65
+ '28': 'Andhra Pradesh',
66
+ '29': 'Karnataka',
67
+ '30': 'Goa',
68
+ '31': 'Lakshadweep',
69
+ '32': 'Kerala',
70
+ '33': 'Tamil Nadu',
71
+ '34': 'Puducherry',
72
+ '35': 'Anadaman and Nicobar Islands',
73
+ '36': 'Telangana',
74
+ '37': 'Andhra Pradesh (New)',
75
+ };
76
+
77
+ const VALID_STATE_CODES = Object.keys(STATE_CODES);
78
+
79
+ const impl: Validator = {
80
+ name: 'NAME',
81
+ localName: 'NAME',
82
+ abbreviation: 'GSTIN',
83
+
84
+ compact(input: string): string {
85
+ const [value, err] = clean(input);
86
+
87
+ if (err) {
88
+ throw err;
89
+ }
90
+
91
+ return value;
92
+ },
93
+
94
+ format(input: string): string {
95
+ const [value] = clean(input);
96
+
97
+ return value;
98
+ },
99
+
100
+ validate(input: string): ValidateReturn {
101
+ const [value, error] = clean(input);
102
+
103
+ if (error) {
104
+ return { isValid: false, error };
105
+ }
106
+ if (value.length !== 15) {
107
+ return { isValid: false, error: new exceptions.InvalidLength() };
108
+ }
109
+
110
+ if (!validRe.test(value)) {
111
+ return { isValid: false, error: new exceptions.InvalidFormat() };
112
+ }
113
+
114
+ const [state, panValue] = strings.splitAt(value, 2, 12);
115
+ if (!VALID_STATE_CODES.includes(state)) {
116
+ return { isValid: false, error: new exceptions.InvalidComponent() };
117
+ }
118
+ if (value[12] === '0' || value[13] !== 'Z') {
119
+ return { isValid: false, error: new exceptions.InvalidComponent() };
120
+ }
121
+ if (!panValidate(panValue).isValid) {
122
+ return { isValid: false, error: new exceptions.InvalidComponent() };
123
+ }
124
+
125
+ const [first, check] = strings.splitAt(value, -1);
126
+
127
+ const sum = first
128
+ .split('')
129
+ .map((char, index) => {
130
+ const product = ALPHABET.indexOf(char) * (index % 2 !== 0 ? 2 : 1);
131
+
132
+ return (
133
+ Math.floor(product / ALPHABET.length) + (product % ALPHABET.length)
134
+ );
135
+ })
136
+ .reduce((prev, current) => {
137
+ return prev + current;
138
+ });
139
+
140
+ const checksum =
141
+ (ALPHABET.length - (sum % ALPHABET.length)) % ALPHABET.length;
142
+ if (ALPHABET[checksum] !== check) {
143
+ return { isValid: false, error: new exceptions.InvalidChecksum() };
144
+ }
145
+
146
+ return {
147
+ isValid: true,
148
+ compact: value,
149
+ isIndividual: false,
150
+ isCompany: true,
151
+ };
152
+ },
153
+ };
154
+
155
+ export const { name, localName, abbreviation, validate, format, compact } =
156
+ impl;
@@ -0,0 +1,4 @@
1
+ export * as aadhaar from './aadhaar';
2
+ export * as pan from './pan';
3
+ export * as epic from './epic';
4
+ export * as gstin from './gstin';
@@ -0,0 +1,40 @@
1
+ import { validate, format } from './pan';
2
+ import { InvalidLength, InvalidFormat, InvalidComponent } from '../exceptions';
3
+
4
+ describe('in/pan', () => {
5
+ it('format:AAPPV8261K', () => {
6
+ const result = format('AAPPV8261K');
7
+
8
+ expect(result).toEqual('AAPPV8261K');
9
+ });
10
+
11
+ it('validate:ACUPA7085R', () => {
12
+ const result = validate('ACUPA7085R');
13
+
14
+ expect(result.isValid && result.compact).toEqual('ACUPA7085R');
15
+ });
16
+
17
+ it('validate:ABMPA32111', () => {
18
+ const result = validate('ABMPA32111');
19
+
20
+ expect(result.error).toBeInstanceOf(InvalidFormat);
21
+ });
22
+
23
+ it('validate:ABMXA3211G', () => {
24
+ const result = validate('ABMXA3211G');
25
+
26
+ expect(result.error).toBeInstanceOf(InvalidComponent);
27
+ });
28
+
29
+ it('validate:234123412347', () => {
30
+ const result = validate('234123412347');
31
+
32
+ expect(result.error).toBeInstanceOf(InvalidLength);
33
+ });
34
+
35
+ // it('validate:2449/494/16/0', () => {
36
+ // const result = validate('2449/494/16/0');
37
+
38
+ // expect(result.error).toBeInstanceOf(InvalidChecksum);
39
+ // });
40
+ });