n2words 5.1.0 → 5.1.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 (148) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/dist/am-ET.js +1 -1
  3. package/dist/am-ET.umd.js +1 -1
  4. package/dist/am-Latn-ET.js +1 -1
  5. package/dist/am-Latn-ET.umd.js +1 -1
  6. package/dist/ar-SA.js +1 -1
  7. package/dist/ar-SA.umd.js +1 -1
  8. package/dist/az-AZ.js +1 -1
  9. package/dist/az-AZ.umd.js +1 -1
  10. package/dist/bn-BD.js +1 -1
  11. package/dist/bn-BD.umd.js +1 -1
  12. package/dist/cs-CZ.js +1 -1
  13. package/dist/cs-CZ.umd.js +1 -1
  14. package/dist/da-DK.js +1 -1
  15. package/dist/da-DK.umd.js +1 -1
  16. package/dist/de-DE.js +1 -1
  17. package/dist/de-DE.umd.js +1 -1
  18. package/dist/el-GR.js +1 -1
  19. package/dist/el-GR.umd.js +1 -1
  20. package/dist/en-AU.js +1 -1
  21. package/dist/en-AU.umd.js +1 -1
  22. package/dist/en-BD.js +1 -1
  23. package/dist/en-BD.umd.js +1 -1
  24. package/dist/en-CA.js +1 -1
  25. package/dist/en-CA.umd.js +1 -1
  26. package/dist/en-GB.js +1 -1
  27. package/dist/en-GB.umd.js +1 -1
  28. package/dist/en-GH.js +1 -1
  29. package/dist/en-GH.umd.js +1 -1
  30. package/dist/en-IE.js +1 -1
  31. package/dist/en-IE.umd.js +1 -1
  32. package/dist/en-IN.js +1 -1
  33. package/dist/en-IN.umd.js +1 -1
  34. package/dist/en-KE.js +1 -1
  35. package/dist/en-KE.umd.js +1 -1
  36. package/dist/en-MY.js +1 -1
  37. package/dist/en-MY.umd.js +1 -1
  38. package/dist/en-NG.js +1 -1
  39. package/dist/en-NG.umd.js +1 -1
  40. package/dist/en-NZ.js +1 -1
  41. package/dist/en-NZ.umd.js +1 -1
  42. package/dist/en-PH.js +1 -1
  43. package/dist/en-PH.umd.js +1 -1
  44. package/dist/en-PK.js +1 -1
  45. package/dist/en-PK.umd.js +1 -1
  46. package/dist/en-SG.js +1 -1
  47. package/dist/en-SG.umd.js +1 -1
  48. package/dist/en-US.js +1 -1
  49. package/dist/en-US.umd.js +1 -1
  50. package/dist/en-ZA.js +1 -1
  51. package/dist/en-ZA.umd.js +1 -1
  52. package/dist/es-ES.js +1 -1
  53. package/dist/es-ES.umd.js +1 -1
  54. package/dist/es-MX.js +1 -1
  55. package/dist/es-MX.umd.js +1 -1
  56. package/dist/es-US.js +1 -1
  57. package/dist/es-US.umd.js +1 -1
  58. package/dist/fa-IR.js +1 -1
  59. package/dist/fa-IR.umd.js +1 -1
  60. package/dist/fi-FI.js +1 -1
  61. package/dist/fi-FI.umd.js +1 -1
  62. package/dist/fil-PH.js +1 -1
  63. package/dist/fil-PH.umd.js +1 -1
  64. package/dist/fr-BE.js +1 -1
  65. package/dist/fr-BE.umd.js +1 -1
  66. package/dist/fr-FR.js +1 -1
  67. package/dist/fr-FR.umd.js +1 -1
  68. package/dist/gu-IN.js +1 -1
  69. package/dist/gu-IN.umd.js +1 -1
  70. package/dist/ha-NG.js +1 -1
  71. package/dist/ha-NG.umd.js +1 -1
  72. package/dist/hbo-IL.js +1 -1
  73. package/dist/hbo-IL.umd.js +1 -1
  74. package/dist/he-IL.js +1 -1
  75. package/dist/he-IL.umd.js +1 -1
  76. package/dist/hi-IN.js +1 -1
  77. package/dist/hi-IN.umd.js +1 -1
  78. package/dist/hr-HR.js +1 -1
  79. package/dist/hr-HR.umd.js +1 -1
  80. package/dist/hu-HU.js +1 -1
  81. package/dist/hu-HU.umd.js +1 -1
  82. package/dist/id-ID.js +1 -1
  83. package/dist/id-ID.umd.js +1 -1
  84. package/dist/it-IT.js +1 -1
  85. package/dist/it-IT.umd.js +1 -1
  86. package/dist/ja-JP.js +1 -1
  87. package/dist/ja-JP.umd.js +1 -1
  88. package/dist/ka-GE.js +1 -1
  89. package/dist/ka-GE.umd.js +1 -1
  90. package/dist/kn-IN.js +1 -1
  91. package/dist/kn-IN.umd.js +1 -1
  92. package/dist/ko-KR.js +1 -1
  93. package/dist/ko-KR.umd.js +1 -1
  94. package/dist/lt-LT.js +1 -1
  95. package/dist/lt-LT.umd.js +1 -1
  96. package/dist/lv-LV.js +1 -1
  97. package/dist/lv-LV.umd.js +1 -1
  98. package/dist/mr-IN.js +1 -1
  99. package/dist/mr-IN.umd.js +1 -1
  100. package/dist/ms-MY.js +1 -1
  101. package/dist/ms-MY.umd.js +1 -1
  102. package/dist/nb-NO.js +1 -1
  103. package/dist/nb-NO.umd.js +1 -1
  104. package/dist/nl-NL.js +1 -1
  105. package/dist/nl-NL.umd.js +1 -1
  106. package/dist/pa-IN.js +1 -1
  107. package/dist/pa-IN.umd.js +1 -1
  108. package/dist/pl-PL.js +1 -1
  109. package/dist/pl-PL.umd.js +1 -1
  110. package/dist/pt-BR.js +1 -1
  111. package/dist/pt-BR.umd.js +1 -1
  112. package/dist/pt-PT.js +1 -1
  113. package/dist/pt-PT.umd.js +1 -1
  114. package/dist/ro-RO.js +1 -1
  115. package/dist/ro-RO.umd.js +1 -1
  116. package/dist/ru-RU.js +1 -1
  117. package/dist/ru-RU.umd.js +1 -1
  118. package/dist/sr-Cyrl-RS.js +2 -2
  119. package/dist/sr-Cyrl-RS.umd.js +2 -2
  120. package/dist/sr-Latn-RS.js +2 -2
  121. package/dist/sr-Latn-RS.umd.js +2 -2
  122. package/dist/sv-SE.js +1 -1
  123. package/dist/sv-SE.umd.js +1 -1
  124. package/dist/sw-KE.js +1 -1
  125. package/dist/sw-KE.umd.js +1 -1
  126. package/dist/ta-IN.js +1 -1
  127. package/dist/ta-IN.umd.js +1 -1
  128. package/dist/te-IN.js +1 -1
  129. package/dist/te-IN.umd.js +1 -1
  130. package/dist/th-TH.js +1 -1
  131. package/dist/th-TH.umd.js +1 -1
  132. package/dist/tr-TR.js +1 -1
  133. package/dist/tr-TR.umd.js +1 -1
  134. package/dist/uk-UA.js +1 -1
  135. package/dist/uk-UA.umd.js +1 -1
  136. package/dist/ur-PK.js +1 -1
  137. package/dist/ur-PK.umd.js +1 -1
  138. package/dist/vi-VN.js +1 -1
  139. package/dist/vi-VN.umd.js +1 -1
  140. package/dist/yo-NG.js +1 -1
  141. package/dist/yo-NG.umd.js +1 -1
  142. package/dist/zh-Hans-CN.js +1 -1
  143. package/dist/zh-Hans-CN.umd.js +1 -1
  144. package/dist/zh-Hant-TW.js +1 -1
  145. package/dist/zh-Hant-TW.umd.js +1 -1
  146. package/package.json +13 -13
  147. package/src/sr-Cyrl-RS.js +6 -5
  148. package/src/sr-Latn-RS.js +6 -5
package/dist/fr-FR.umd.js CHANGED
@@ -1,2 +1,2 @@
1
- /*! n2words/fr-FR v5.1.0 | MIT License | github.com/forzagreen/n2words */
1
+ /*! n2words/fr-FR v5.1.1 | MIT License | github.com/forzagreen/n2words */
2
2
  var e,n;e=this,n=function(e){"use strict";function n(e){let[n,t]=e.toLowerCase().split("e");const i=parseInt(t,10);let r="";"-"===n[0]&&(r="-",n=n.slice(1));const s=n.indexOf("."),o=-1===s?n:n.slice(0,s)+n.slice(s+1),u=(-1===s?n.length:s)+i;return u>=o.length?r+o+"0".repeat(u-o.length):u<=0?r+"0."+"0".repeat(-u)+o:r+o.slice(0,u)+"."+o.slice(u)}function t(e){const t=e.toString();return i(t)?n(t):t}function i(e){return e.includes("e")||e.includes("E")}function r(e){const n="-"===e[0];n&&(e=e.slice(1));const t=e.indexOf(".");if(-1===t)return{isNegative:n,integerPart:BigInt(e)};const i=e.slice(0,t)||"0",r=e.slice(t+1);return{isNegative:n,integerPart:BigInt(i),decimalPart:r}}function s(e){let t=e.trim();if(0===t.length||Number.isNaN(Number(t)))throw new RangeError(`Invalid currency format: "${e}"`);i(t)&&(t=n(t));const r="-"===t[0];r&&(t=t.slice(1));const s=t.indexOf(".");if(-1===s)return{isNegative:r,dollars:BigInt(t),cents:0n};const o=t.slice(0,s)||"0",u=(t.slice(s+1)+"00").slice(0,2);return{isNegative:r,dollars:BigInt(o),cents:BigInt(u)}}function o(e,n,t){if(null===n)return;if(e<n&&!(t&&BigInt(t)>=n))return;const i=n.toString().length-1,r=n===10n**BigInt(i)?`10^${i} - 1`:""+(n-1n);throw new RangeError(`Number too large to convert: the largest supported value is ${r}`)}function u(e){return 10n**BigInt(6*(e+1))}function l(e,n,t){const i={...n};if(void 0===e)return i;if(!function(e){if(null===e||"object"!=typeof e)return!1;const n=Object.getPrototypeOf(e);return null===n||n===Object.prototype}(e))throw new TypeError("Invalid options: expected plain object or undefined, got "+typeof e);const r=Object.keys(n);for(const[t,s]of Object.entries(e)){if(!Object.hasOwn(n,t))throw new TypeError(`Unknown option "${t}" — expected one of: ${r.join(", ")}`);if(void 0!==s){if(typeof s!=typeof i[t])throw new TypeError(`Option "${t}" must be a ${typeof i[t]}, got ${typeof s}`);i[t]=s}}return i}const c=["","un","deux","trois","quatre","cinq","six","sept","huit","neuf"],a=["dix","onze","douze","treize","quatorze","quinze","seize","dix-sept","dix-huit","dix-neuf"],f=["","","vingt","trente","quarante","cinquante","soixante"],g=["million","billion","trillion","quadrillion"],d=["milliard","billiard","trilliard","quadrilliard"],h=u(g.length),p=u(g.length),b=u(g.length),m="mille",w="cent",v="zéro",y="moins",N="ième";function I(e){if(0===e)return{word:"",endsWithCents:!1,endsWithVingts:!1};const n=e%100,t=Math.trunc(e/100),i=[];let r=!1,s=!1;if(t>0&&(1===t?i.push(w):0===n?(i.push(c[t]+" "+w+"s"),r=!0):i.push(c[t]+" "+w)),0===n);else if(n<10)i.push(c[n]);else if(n<17)i.push(a[n-10]);else if(n<20)i.push(a[n-10]);else if(n<70){const e=Math.trunc(n/10),t=n%10;i.push(0===t?f[e]:1===t?f[e]+" et "+c[1]:f[e]+"-"+c[t])}else if(n<80){const e=n-60;i.push(11===e?"soixante et onze":"soixante-"+a[e-10])}else if(80===n)i.push("quatre-vingts"),s=!0;else if(n<100){const e=n-80;i.push(e<10?"quatre-vingt-"+c[e]:"quatre-vingt-"+a[e-10])}return{word:i.join(" "),endsWithCents:r,endsWithVingts:s}}function E(e,n){if(1===e)return m;if(e%2==0){const t=g[e/2-1];return t?n>1n?t+"s":t:""}{const t=d[(e-1)/2-1];return t?n>1n?t+"s":t:m}}function O(e,n=!1){if(0n===e)return v;if(e<1000n){const{word:t}=I(Number(e));return n?t.replace(/ /g,"-"):t}if(e<1000000n){const t=Number(e/1000n),i=Number(e%1000n);let r;if(1===t)r=m;else{const{word:e,endsWithCents:i,endsWithVingts:s}=I(t);let o=e;(i||s)&&(o=e.slice(0,-1)),r=o+(n?"-":" ")+m}if(i>0){const{word:e}=I(i);r+=(n?"-":" ")+e}return n&&(r=r.replace(/ /g,"-")),r}return function(e,n){const t=e.toString(),i=t.length,r=[],s=i%3;let o=0;for(s>0&&(r.push(Number(t.slice(0,s))),o=s);o<i;)r.push(Number(t.slice(o,o+3))),o+=3;const u=[];let l=r.length-1;for(let e=0;e<r.length;e++){const n=r[e];if(0!==n){const e=l>0?E(l,BigInt(n)):"",{word:t,endsWithCents:i,endsWithVingts:r}=I(n);if(0===l)u.push(t);else if(1===l)if(1===n)u.push(m);else{let n=t;(i||r)&&(n=t.slice(0,-1)),u.push(n),u.push(e)}else u.push(t),u.push(e)}l--}let c=u.join(n?"-":" ");return n&&(c=c.replace(/ /g,"-")),c}(e,n)}const W={withHyphenSeparator:!1},x={and:!0},R={frFR:function(e){const t=function(e){const t=typeof e;if("bigint"==typeof e){if(e<=0n)throw new RangeError("Ordinals must be positive integers");return e}if("number"==typeof e){if(!Number.isFinite(e))throw new RangeError("Ordinals must be finite numbers");if(!Number.isInteger(e))throw new RangeError("Ordinals must be whole numbers");if(e<=0)throw new RangeError("Ordinals must be positive integers");return BigInt(e)}if("string"==typeof e)return function(e){const t=e.trim();if(0===t.length)throw new RangeError("Ordinals cannot be empty strings");if("-"===t[0])throw new RangeError("Ordinals cannot be negative");if(t.includes("."))throw new RangeError("Ordinals must be whole numbers");if(i(t)){const e=n(t);if(e.includes("."))throw new RangeError("Ordinals must be whole numbers");const i=BigInt(e);if(i<=0n)throw new RangeError("Ordinals must be positive integers");return i}try{const e=BigInt(t);if(e<=0n)throw new RangeError("Ordinals must be positive integers");return e}catch(n){if(n instanceof RangeError)throw n;throw new RangeError(`Invalid ordinal format: "${e}"`,{cause:n})}}(e);throw new TypeError(`Invalid value type: expected number, string, or bigint, received ${t}`)}(e);return o(t,p),1n===(r=t)?"premier":(s=O(r,!1)).endsWith("cinq")?s+"u"+N:s.endsWith("neuf")?s.slice(0,-1)+"v"+N:s.endsWith("cents")||s.endsWith("vingts")||s.endsWith("millions")||s.endsWith("milliards")||s.endsWith("billions")||s.endsWith("billiards")||s.endsWith("trillions")||s.endsWith("trilliards")||s.endsWith("quadrillions")||s.endsWith("quadrilliards")||s.endsWith("e")?s.slice(0,-1)+N:s+N;var r,s}};e.currency={frFR:function(e,n){const{isNegative:i,dollars:r,cents:u}=function(e){const n=typeof e;if("bigint"==typeof e)return e<0n?{isNegative:!0,dollars:-e,cents:0n}:{isNegative:!1,dollars:e,cents:0n};if("number"==typeof e){if(!Number.isFinite(e))throw new RangeError("Currency must be a finite number");return Number.isSafeInteger(e)?e<0?{isNegative:!0,dollars:BigInt(-e),cents:0n}:{isNegative:!1,dollars:BigInt(e),cents:0n}:s(t(e))}if("string"==typeof e)return s(e);throw new TypeError(`Invalid value type: expected number, string, or bigint, received ${n}`)}(e);o(r,b);const{and:c}=l(n,x);let a="";return i&&(a=y+" "),(r>0n||0n===u)&&(a+=O(r,!1),a+=" "+(r<=1n?"euro":"euros")),u>0n&&(r>0n&&(a+=c?" et ":" "),a+=O(u,!1),a+=" "+(1n===u?"centime":"centimes")),a}},e.frFR=function(e,s){const{isNegative:u,integerPart:c,decimalPart:a}=function(e){const s=typeof e;if("bigint"==typeof e)return e<0n?{isNegative:!0,integerPart:-e}:{isNegative:!1,integerPart:e};if("number"==typeof e){if(!Number.isFinite(e))throw new RangeError("Number must be finite (NaN and Infinity are not supported)");return Number.isSafeInteger(e)?e<0?{isNegative:!0,integerPart:BigInt(-e)}:{isNegative:!1,integerPart:BigInt(e)}:r(t(e))}if("string"==typeof e)return r(function(e){const t=e.trim();if(0===t.length||Number.isNaN(Number(t)))throw new RangeError(`Invalid number format: "${e}"`);return i(t)?n(t):t}(e));throw new TypeError(`Invalid value type: expected number, string, or bigint, received ${s}`)}(e);o(c,h,a);const{withHyphenSeparator:f}=l(s,W);let g="";const d=f?"-":" ";return u&&(g=y+d),g+=O(c,f),a&&(g+=d+"virgule"+d+function(e,n){let t="";const i=n?"-":" ";let r=0;for(;r<e.length&&"0"===e[r];)t&&(t+=i),t+=v,r++;const s=e.slice(r);return s&&(t&&(t+=i),t+=O(BigInt(s),n)),t}(a,f)),g},e.ordinal=R},"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((e="undefined"!=typeof globalThis?globalThis:e||self).n2words=e.n2words||{});
package/dist/gu-IN.js CHANGED
@@ -1,2 +1,2 @@
1
- /*! n2words/gu-IN v5.1.0 | MIT License | github.com/forzagreen/n2words */
1
+ /*! n2words/gu-IN v5.1.1 | MIT License | github.com/forzagreen/n2words */
2
2
  function e(e){let[n,t]=e.toLowerCase().split("e");const r=parseInt(t,10);let i="";"-"===n[0]&&(i="-",n=n.slice(1));const o=n.indexOf("."),s=-1===o?n:n.slice(0,o)+n.slice(o+1),u=(-1===o?n.length:o)+r;return u>=s.length?i+s+"0".repeat(u-s.length):u<=0?i+"0."+"0".repeat(-u)+s:i+s.slice(0,u)+"."+s.slice(u)}function n(n){const r=n.toString();return t(r)?e(r):r}function t(e){return e.includes("e")||e.includes("E")}function r(e){const n="-"===e[0];n&&(e=e.slice(1));const t=e.indexOf(".");if(-1===t)return{isNegative:n,integerPart:BigInt(e)};const r=e.slice(0,t)||"0",i=e.slice(t+1);return{isNegative:n,integerPart:BigInt(r),decimalPart:i}}function i(n){let r=n.trim();if(0===r.length||Number.isNaN(Number(r)))throw new RangeError(`Invalid currency format: "${n}"`);t(r)&&(r=e(r));const i="-"===r[0];i&&(r=r.slice(1));const o=r.indexOf(".");if(-1===o)return{isNegative:i,dollars:BigInt(r),cents:0n};const s=r.slice(0,o)||"0",u=(r.slice(o+1)+"00").slice(0,2);return{isNegative:i,dollars:BigInt(s),cents:BigInt(u)}}function o(e,n,t){if(null===n)return;if(e<n)return;const r=n.toString().length-1,i=n===10n**BigInt(r)?`10^${r} - 1`:""+(n-1n);throw new RangeError(`Number too large to convert: the largest supported value is ${i}`)}function s(e){return 10n**BigInt(3+2*(e-1))}const u="શૂન્ય",a=["","પહેલું","બીજું","ત્રીજું","ચોથું","પાંચમું","છઠ્ઠું"],c=["શૂન્ય","એક","બે","ત્રણ","ચાર","પાંચ","છ","સાત","આઠ","નવ","દસ","અગિયાર","બાર","તેર","ચૌદ","પંદર","સોળ","સત્તર","અઢાર","ઓગણીસ","વીસ","એકવીસ","બાવીસ","ત્રેવીસ","ચોવીસ","પચીસ","છવ્વીસ","સત્તાવીસ","અઠ્ઠાવીસ","ઓગણત્રીસ","ત્રીસ","એકત્રીસ","બત્રીસ","તેત્રીસ","ચોત્રીસ","પાંત્રીસ","છત્રીસ","સાડત્રીસ","અડત્રીસ","ઓગણચાલીસ","ચાલીસ","એકતાલીસ","બેતાળીસ","ત્રેતાળીસ","ચુંમાલીસ","પિસ્તાલીસ","છેતાળીસ","સુડતાળીસ","અડતાળીસ","ઓગણપચાસ","પચાસ","એકાવન","બાવન","ત્રેપન","ચોપન","પંચાવન","છપ્પન","સત્તાવન","અઠ્ઠાવન","ઓગણસાઠ","સાઠ","એકસઠ","બાસઠ","ત્રેસઠ","ચોસઠ","પાંસઠ","છાસઠ","સડસઠ","અડસઠ","અગણોસિત્તેર","સિત્તેર","એકોતેર","બોતેર","તોતેર","ચુમોતેર","પંચોતેર","છોતેર","સિત્યોતેર","ઇઠ્યોતેર","ઓગણાએંસી","એંસી","એક્યાસી","બ્યાસી","ત્યાસી","ચોર્યાસી","પંચાસી","છ્યાસી","સિત્યાસી","અઠ્યાસી","નેવ્યાસી","નેવું","એકાણું","બાણું","ત્રાણું","ચોરાણું","પંચાણું","છન્નું","સત્તાણું","અઠ્ઠાણું","નવ્વાણું"],g=["","હજાર","લાખ","કરોડ","અબજ","ખરબ","નીલ","પદ્મ","શંખ"],f=s(g.length),l=s(g.length),m=s(g.length);function b(e){if(0===e)return"";if(e<100)return c[e];const n=Math.trunc(e/100),t=e%100;return 0===t?c[n]+" સો":c[n]+" સો "+c[t]}function w(e){if(0n===e)return u;if(e<1000n)return b(Number(e));const n=[];n.push(Number(e%1000n));let t=e/1000n;for(;t>0n;)n.push(Number(t%100n)),t/=100n;const r=[];for(let e=n.length-1;e>=0;e--){const t=n[e];0!==t&&(r.push(0===e?b(t):c[t]),e>0&&g[e]&&r.push(g[e]))}return r.join(" ")}function d(i){const{isNegative:s,integerPart:a,decimalPart:g}=function(i){const o=typeof i;if("bigint"==typeof i)return i<0n?{isNegative:!0,integerPart:-i}:{isNegative:!1,integerPart:i};if("number"==typeof i){if(!Number.isFinite(i))throw new RangeError("Number must be finite (NaN and Infinity are not supported)");return Number.isSafeInteger(i)?i<0?{isNegative:!0,integerPart:BigInt(-i)}:{isNegative:!1,integerPart:BigInt(i)}:r(n(i))}if("string"==typeof i)return r(function(n){const r=n.trim();if(0===r.length||Number.isNaN(Number(r)))throw new RangeError(`Invalid number format: "${n}"`);return t(r)?e(r):r}(i));throw new TypeError(`Invalid value type: expected number, string, or bigint, received ${o}`)}(i);o(a,f);let l="";return s&&(l="ઋણ "),l+=w(a),g&&(l+=" દશાંશ "+function(e){const n=[];for(const t of e){const e=parseInt(t,10);n.push(0===e?u:c[e])}return n.join(" ")}(g)),l}function h(n){const r=function(n){const r=typeof n;if("bigint"==typeof n){if(n<=0n)throw new RangeError("Ordinals must be positive integers");return n}if("number"==typeof n){if(!Number.isFinite(n))throw new RangeError("Ordinals must be finite numbers");if(!Number.isInteger(n))throw new RangeError("Ordinals must be whole numbers");if(n<=0)throw new RangeError("Ordinals must be positive integers");return BigInt(n)}if("string"==typeof n)return function(n){const r=n.trim();if(0===r.length)throw new RangeError("Ordinals cannot be empty strings");if("-"===r[0])throw new RangeError("Ordinals cannot be negative");if(r.includes("."))throw new RangeError("Ordinals must be whole numbers");if(t(r)){const n=e(r);if(n.includes("."))throw new RangeError("Ordinals must be whole numbers");const t=BigInt(n);if(t<=0n)throw new RangeError("Ordinals must be positive integers");return t}try{const e=BigInt(r);if(e<=0n)throw new RangeError("Ordinals must be positive integers");return e}catch(e){if(e instanceof RangeError)throw e;throw new RangeError(`Invalid ordinal format: "${n}"`,{cause:e})}}(n);throw new TypeError(`Invalid value type: expected number, string, or bigint, received ${r}`)}(n);return o(r,l),(i=r)>=1n&&i<=6n?a[Number(i)]:w(i)+"મું";var i}function p(e){const{isNegative:t,dollars:r,cents:s}=function(e){const t=typeof e;if("bigint"==typeof e)return e<0n?{isNegative:!0,dollars:-e,cents:0n}:{isNegative:!1,dollars:e,cents:0n};if("number"==typeof e){if(!Number.isFinite(e))throw new RangeError("Currency must be a finite number");return Number.isSafeInteger(e)?e<0?{isNegative:!0,dollars:BigInt(-e),cents:0n}:{isNegative:!1,dollars:BigInt(e),cents:0n}:i(n(e))}if("string"==typeof e)return i(e);throw new TypeError(`Invalid value type: expected number, string, or bigint, received ${t}`)}(e);o(r,m);let u="";return t&&(u="ઋણ "),(r>0n||0n===s)&&(u+=w(r),u+=" "+(1n===r?"રૂપિયો":"રૂપિયા")),s>0n&&(r>0n&&(u+=" "),u+=w(s),u+=" "+(1n===s?"પૈસો":"પૈસા")),u}export{f as cardinalMax,m as currencyMax,l as ordinalMax,d as toCardinal,p as toCurrency,h as toOrdinal};
package/dist/gu-IN.umd.js CHANGED
@@ -1,2 +1,2 @@
1
- /*! n2words/gu-IN v5.1.0 | MIT License | github.com/forzagreen/n2words */
1
+ /*! n2words/gu-IN v5.1.1 | MIT License | github.com/forzagreen/n2words */
2
2
  var e,n;e=this,n=function(e){"use strict";function n(e){let[n,t]=e.toLowerCase().split("e");const r=parseInt(t,10);let i="";"-"===n[0]&&(i="-",n=n.slice(1));const o=n.indexOf("."),s=-1===o?n:n.slice(0,o)+n.slice(o+1),u=(-1===o?n.length:o)+r;return u>=s.length?i+s+"0".repeat(u-s.length):u<=0?i+"0."+"0".repeat(-u)+s:i+s.slice(0,u)+"."+s.slice(u)}function t(e){const t=e.toString();return r(t)?n(t):t}function r(e){return e.includes("e")||e.includes("E")}function i(e){const n="-"===e[0];n&&(e=e.slice(1));const t=e.indexOf(".");if(-1===t)return{isNegative:n,integerPart:BigInt(e)};const r=e.slice(0,t)||"0",i=e.slice(t+1);return{isNegative:n,integerPart:BigInt(r),decimalPart:i}}function o(e){let t=e.trim();if(0===t.length||Number.isNaN(Number(t)))throw new RangeError(`Invalid currency format: "${e}"`);r(t)&&(t=n(t));const i="-"===t[0];i&&(t=t.slice(1));const o=t.indexOf(".");if(-1===o)return{isNegative:i,dollars:BigInt(t),cents:0n};const s=t.slice(0,o)||"0",u=(t.slice(o+1)+"00").slice(0,2);return{isNegative:i,dollars:BigInt(s),cents:BigInt(u)}}function s(e,n,t){if(null===n)return;if(e<n)return;const r=n.toString().length-1,i=n===10n**BigInt(r)?`10^${r} - 1`:""+(n-1n);throw new RangeError(`Number too large to convert: the largest supported value is ${i}`)}function u(e){return 10n**BigInt(3+2*(e-1))}const a="શૂન્ય",c=["","પહેલું","બીજું","ત્રીજું","ચોથું","પાંચમું","છઠ્ઠું"],g=["શૂન્ય","એક","બે","ત્રણ","ચાર","પાંચ","છ","સાત","આઠ","નવ","દસ","અગિયાર","બાર","તેર","ચૌદ","પંદર","સોળ","સત્તર","અઢાર","ઓગણીસ","વીસ","એકવીસ","બાવીસ","ત્રેવીસ","ચોવીસ","પચીસ","છવ્વીસ","સત્તાવીસ","અઠ્ઠાવીસ","ઓગણત્રીસ","ત્રીસ","એકત્રીસ","બત્રીસ","તેત્રીસ","ચોત્રીસ","પાંત્રીસ","છત્રીસ","સાડત્રીસ","અડત્રીસ","ઓગણચાલીસ","ચાલીસ","એકતાલીસ","બેતાળીસ","ત્રેતાળીસ","ચુંમાલીસ","પિસ્તાલીસ","છેતાળીસ","સુડતાળીસ","અડતાળીસ","ઓગણપચાસ","પચાસ","એકાવન","બાવન","ત્રેપન","ચોપન","પંચાવન","છપ્પન","સત્તાવન","અઠ્ઠાવન","ઓગણસાઠ","સાઠ","એકસઠ","બાસઠ","ત્રેસઠ","ચોસઠ","પાંસઠ","છાસઠ","સડસઠ","અડસઠ","અગણોસિત્તેર","સિત્તેર","એકોતેર","બોતેર","તોતેર","ચુમોતેર","પંચોતેર","છોતેર","સિત્યોતેર","ઇઠ્યોતેર","ઓગણાએંસી","એંસી","એક્યાસી","બ્યાસી","ત્યાસી","ચોર્યાસી","પંચાસી","છ્યાસી","સિત્યાસી","અઠ્યાસી","નેવ્યાસી","નેવું","એકાણું","બાણું","ત્રાણું","ચોરાણું","પંચાણું","છન્નું","સત્તાણું","અઠ્ઠાણું","નવ્વાણું"],f=["","હજાર","લાખ","કરોડ","અબજ","ખરબ","નીલ","પદ્મ","શંખ"],l=u(f.length),d=u(f.length),b=u(f.length);function m(e){if(0===e)return"";if(e<100)return g[e];const n=Math.trunc(e/100),t=e%100;return 0===t?g[n]+" સો":g[n]+" સો "+g[t]}function p(e){if(0n===e)return a;if(e<1000n)return m(Number(e));const n=[];n.push(Number(e%1000n));let t=e/1000n;for(;t>0n;)n.push(Number(t%100n)),t/=100n;const r=[];for(let e=n.length-1;e>=0;e--){const t=n[e];0!==t&&(r.push(0===e?m(t):g[t]),e>0&&f[e]&&r.push(f[e]))}return r.join(" ")}const h={guIN:function(e){const t=function(e){const t=typeof e;if("bigint"==typeof e){if(e<=0n)throw new RangeError("Ordinals must be positive integers");return e}if("number"==typeof e){if(!Number.isFinite(e))throw new RangeError("Ordinals must be finite numbers");if(!Number.isInteger(e))throw new RangeError("Ordinals must be whole numbers");if(e<=0)throw new RangeError("Ordinals must be positive integers");return BigInt(e)}if("string"==typeof e)return function(e){const t=e.trim();if(0===t.length)throw new RangeError("Ordinals cannot be empty strings");if("-"===t[0])throw new RangeError("Ordinals cannot be negative");if(t.includes("."))throw new RangeError("Ordinals must be whole numbers");if(r(t)){const e=n(t);if(e.includes("."))throw new RangeError("Ordinals must be whole numbers");const r=BigInt(e);if(r<=0n)throw new RangeError("Ordinals must be positive integers");return r}try{const e=BigInt(t);if(e<=0n)throw new RangeError("Ordinals must be positive integers");return e}catch(n){if(n instanceof RangeError)throw n;throw new RangeError(`Invalid ordinal format: "${e}"`,{cause:n})}}(e);throw new TypeError(`Invalid value type: expected number, string, or bigint, received ${t}`)}(e);return s(t,d),(i=t)>=1n&&i<=6n?c[Number(i)]:p(i)+"મું";var i}};e.currency={guIN:function(e){const{isNegative:n,dollars:r,cents:i}=function(e){const n=typeof e;if("bigint"==typeof e)return e<0n?{isNegative:!0,dollars:-e,cents:0n}:{isNegative:!1,dollars:e,cents:0n};if("number"==typeof e){if(!Number.isFinite(e))throw new RangeError("Currency must be a finite number");return Number.isSafeInteger(e)?e<0?{isNegative:!0,dollars:BigInt(-e),cents:0n}:{isNegative:!1,dollars:BigInt(e),cents:0n}:o(t(e))}if("string"==typeof e)return o(e);throw new TypeError(`Invalid value type: expected number, string, or bigint, received ${n}`)}(e);s(r,b);let u="";return n&&(u="ઋણ "),(r>0n||0n===i)&&(u+=p(r),u+=" "+(1n===r?"રૂપિયો":"રૂપિયા")),i>0n&&(r>0n&&(u+=" "),u+=p(i),u+=" "+(1n===i?"પૈસો":"પૈસા")),u}},e.guIN=function(e){const{isNegative:o,integerPart:u,decimalPart:c}=function(e){const o=typeof e;if("bigint"==typeof e)return e<0n?{isNegative:!0,integerPart:-e}:{isNegative:!1,integerPart:e};if("number"==typeof e){if(!Number.isFinite(e))throw new RangeError("Number must be finite (NaN and Infinity are not supported)");return Number.isSafeInteger(e)?e<0?{isNegative:!0,integerPart:BigInt(-e)}:{isNegative:!1,integerPart:BigInt(e)}:i(t(e))}if("string"==typeof e)return i(function(e){const t=e.trim();if(0===t.length||Number.isNaN(Number(t)))throw new RangeError(`Invalid number format: "${e}"`);return r(t)?n(t):t}(e));throw new TypeError(`Invalid value type: expected number, string, or bigint, received ${o}`)}(e);s(u,l);let f="";return o&&(f="ઋણ "),f+=p(u),c&&(f+=" દશાંશ "+function(e){const n=[];for(const t of e){const e=parseInt(t,10);n.push(0===e?a:g[e])}return n.join(" ")}(c)),f},e.ordinal=h},"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((e="undefined"!=typeof globalThis?globalThis:e||self).n2words=e.n2words||{});
package/dist/ha-NG.js CHANGED
@@ -1,2 +1,2 @@
1
- /*! n2words/ha-NG v5.1.0 | MIT License | github.com/forzagreen/n2words */
1
+ /*! n2words/ha-NG v5.1.1 | MIT License | github.com/forzagreen/n2words */
2
2
  function n(n){let[e,t]=n.toLowerCase().split("e");const r=parseInt(t,10);let i="";"-"===e[0]&&(i="-",e=e.slice(1));const s=e.indexOf("."),o=-1===s?e:e.slice(0,s)+e.slice(s+1),a=(-1===s?e.length:s)+r;return a>=o.length?i+o+"0".repeat(a-o.length):a<=0?i+"0."+"0".repeat(-a)+o:i+o.slice(0,a)+"."+o.slice(a)}function e(e){const r=e.toString();return t(r)?n(r):r}function t(n){return n.includes("e")||n.includes("E")}function r(n){const e="-"===n[0];e&&(n=n.slice(1));const t=n.indexOf(".");if(-1===t)return{isNegative:e,integerPart:BigInt(n)};const r=n.slice(0,t)||"0",i=n.slice(t+1);return{isNegative:e,integerPart:BigInt(r),decimalPart:i}}function i(e){let r=e.trim();if(0===r.length||Number.isNaN(Number(r)))throw new RangeError(`Invalid currency format: "${e}"`);t(r)&&(r=n(r));const i="-"===r[0];i&&(r=r.slice(1));const s=r.indexOf(".");if(-1===s)return{isNegative:i,dollars:BigInt(r),cents:0n};const o=r.slice(0,s)||"0",a=(r.slice(s+1)+"00").slice(0,2);return{isNegative:i,dollars:BigInt(o),cents:BigInt(a)}}function s(n,e,t){if(null===e)return;if(n<e)return;const r=e.toString().length-1,i=e===10n**BigInt(r)?`10^${r} - 1`:""+(e-1n);throw new RangeError(`Number too large to convert: the largest supported value is ${i}`)}function o(n){return 10n**BigInt(3*(n+1))}const a=["","ɗaya","biyu","uku","huɗu","biyar","shida","bakwai","takwas","tara"],u=["goma","sha ɗaya","sha biyu","sha uku","sha huɗu","sha biyar","sha shida","sha bakwai","sha takwas","sha tara"],c=["","","ashirin","talatin","arba'in","hamsin","sittin","saba'in","tamanin","tis'in"],l="ɗari",g="dubu",f="sifiri",h="babu",b=["",g,"miliyan","biliyan"],d=o(b.length-1),m=o(b.length-1),p=o(b.length-1);function w(n){if(0===n)return"";const e=n%10,t=Math.trunc(n/10)%10,r=Math.trunc(n/100),i=[];r>0&&i.push(1===r?l:a[r]+" "+l);const s=n%100;return 0===s||i.push(s<10?r>0?"da "+a[e]:a[e]:s<20?u[e]:0===e?c[t]:c[t]+" da "+a[e]),i.join(" ")}function N(n){return 0n===n?f:n<1000n?w(Number(n)):function(n){const e=n.toString(),t=e.length,r=[],i=t%3;let s=0;for(i>0&&(r.push(Number(e.slice(0,i))),s=i);s<t;)r.push(Number(e.slice(s,s+3))),s+=3;const o=[];let a=r.length-1;for(let n=0;n<r.length;n++){const e=r[n];if(0!==e){const n=b[a]||"";0===a?o.push(w(e)):(o.push(w(e)),o.push(n))}a--}const u=[];for(let n=0;n<o.length;n++){const e=o[n],t=o[n+1];("ɗaya"!==e||!t||t!==l&&t!==g)&&u.push(e)}const c=[];for(let n=0;n<u.length;n++){const e=u[n],t=n>0?u[n-1]:null;t&&v(e)&&(t===g||t===l||b.includes(t))?c.push(" da "):n>0&&c.push(" "),c.push(e)}return c.join("")}(n)}function v(n){return a.slice(1).includes(n)}function y(i){const{isNegative:o,integerPart:u,decimalPart:c}=function(i){const s=typeof i;if("bigint"==typeof i)return i<0n?{isNegative:!0,integerPart:-i}:{isNegative:!1,integerPart:i};if("number"==typeof i){if(!Number.isFinite(i))throw new RangeError("Number must be finite (NaN and Infinity are not supported)");return Number.isSafeInteger(i)?i<0?{isNegative:!0,integerPart:BigInt(-i)}:{isNegative:!1,integerPart:BigInt(i)}:r(e(i))}if("string"==typeof i)return r(function(e){const r=e.trim();if(0===r.length||Number.isNaN(Number(r)))throw new RangeError(`Invalid number format: "${e}"`);return t(r)?n(r):r}(i));throw new TypeError(`Invalid value type: expected number, string, or bigint, received ${s}`)}(i);s(u,d);let l="";return o&&(l=h+" "),l+=N(u),c&&(l+=" digo "+function(n){const e=[];for(const t of n){const n=parseInt(t,10);e.push(0===n?f:a[n])}return e.join(" ")}(c)),l}function I(e){const r=function(e){const r=typeof e;if("bigint"==typeof e){if(e<=0n)throw new RangeError("Ordinals must be positive integers");return e}if("number"==typeof e){if(!Number.isFinite(e))throw new RangeError("Ordinals must be finite numbers");if(!Number.isInteger(e))throw new RangeError("Ordinals must be whole numbers");if(e<=0)throw new RangeError("Ordinals must be positive integers");return BigInt(e)}if("string"==typeof e)return function(e){const r=e.trim();if(0===r.length)throw new RangeError("Ordinals cannot be empty strings");if("-"===r[0])throw new RangeError("Ordinals cannot be negative");if(r.includes("."))throw new RangeError("Ordinals must be whole numbers");if(t(r)){const e=n(r);if(e.includes("."))throw new RangeError("Ordinals must be whole numbers");const t=BigInt(e);if(t<=0n)throw new RangeError("Ordinals must be positive integers");return t}try{const n=BigInt(r);if(n<=0n)throw new RangeError("Ordinals must be positive integers");return n}catch(n){if(n instanceof RangeError)throw n;throw new RangeError(`Invalid ordinal format: "${e}"`,{cause:n})}}(e);throw new TypeError(`Invalid value type: expected number, string, or bigint, received ${r}`)}(e);return s(r,m),1n===(i=r)?"na farko":"na "+N(i);var i}function E(n){const{isNegative:t,dollars:r,cents:o}=function(n){const t=typeof n;if("bigint"==typeof n)return n<0n?{isNegative:!0,dollars:-n,cents:0n}:{isNegative:!1,dollars:n,cents:0n};if("number"==typeof n){if(!Number.isFinite(n))throw new RangeError("Currency must be a finite number");return Number.isSafeInteger(n)?n<0?{isNegative:!0,dollars:BigInt(-n),cents:0n}:{isNegative:!1,dollars:BigInt(n),cents:0n}:i(e(n))}if("string"==typeof n)return i(n);throw new TypeError(`Invalid value type: expected number, string, or bigint, received ${t}`)}(n);s(r,p);let a="";return t&&(a=h+" "),(r>0n||0n===o)&&(a+=N(r)+" naira"),o>0n&&(r>0n&&(a+=" da "),a+=N(o)+" kobo"),a}export{d as cardinalMax,p as currencyMax,m as ordinalMax,y as toCardinal,E as toCurrency,I as toOrdinal};
package/dist/ha-NG.umd.js CHANGED
@@ -1,2 +1,2 @@
1
- /*! n2words/ha-NG v5.1.0 | MIT License | github.com/forzagreen/n2words */
1
+ /*! n2words/ha-NG v5.1.1 | MIT License | github.com/forzagreen/n2words */
2
2
  var n,e;n=this,e=function(n){"use strict";function e(n){let[e,t]=n.toLowerCase().split("e");const r=parseInt(t,10);let i="";"-"===e[0]&&(i="-",e=e.slice(1));const s=e.indexOf("."),o=-1===s?e:e.slice(0,s)+e.slice(s+1),a=(-1===s?e.length:s)+r;return a>=o.length?i+o+"0".repeat(a-o.length):a<=0?i+"0."+"0".repeat(-a)+o:i+o.slice(0,a)+"."+o.slice(a)}function t(n){const t=n.toString();return r(t)?e(t):t}function r(n){return n.includes("e")||n.includes("E")}function i(n){const e="-"===n[0];e&&(n=n.slice(1));const t=n.indexOf(".");if(-1===t)return{isNegative:e,integerPart:BigInt(n)};const r=n.slice(0,t)||"0",i=n.slice(t+1);return{isNegative:e,integerPart:BigInt(r),decimalPart:i}}function s(n){let t=n.trim();if(0===t.length||Number.isNaN(Number(t)))throw new RangeError(`Invalid currency format: "${n}"`);r(t)&&(t=e(t));const i="-"===t[0];i&&(t=t.slice(1));const s=t.indexOf(".");if(-1===s)return{isNegative:i,dollars:BigInt(t),cents:0n};const o=t.slice(0,s)||"0",a=(t.slice(s+1)+"00").slice(0,2);return{isNegative:i,dollars:BigInt(o),cents:BigInt(a)}}function o(n,e,t){if(null===e)return;if(n<e)return;const r=e.toString().length-1,i=e===10n**BigInt(r)?`10^${r} - 1`:""+(e-1n);throw new RangeError(`Number too large to convert: the largest supported value is ${i}`)}function a(n){return 10n**BigInt(3*(n+1))}const u=["","ɗaya","biyu","uku","huɗu","biyar","shida","bakwai","takwas","tara"],c=["goma","sha ɗaya","sha biyu","sha uku","sha huɗu","sha biyar","sha shida","sha bakwai","sha takwas","sha tara"],l=["","","ashirin","talatin","arba'in","hamsin","sittin","saba'in","tamanin","tis'in"],g="ɗari",f="dubu",h="sifiri",d="babu",b=["",f,"miliyan","biliyan"],p=a(b.length-1),m=a(b.length-1),w=a(b.length-1);function N(n){if(0===n)return"";const e=n%10,t=Math.trunc(n/10)%10,r=Math.trunc(n/100),i=[];r>0&&i.push(1===r?g:u[r]+" "+g);const s=n%100;return 0===s||i.push(s<10?r>0?"da "+u[e]:u[e]:s<20?c[e]:0===e?l[t]:l[t]+" da "+u[e]),i.join(" ")}function y(n){return 0n===n?h:n<1000n?N(Number(n)):function(n){const e=n.toString(),t=e.length,r=[],i=t%3;let s=0;for(i>0&&(r.push(Number(e.slice(0,i))),s=i);s<t;)r.push(Number(e.slice(s,s+3))),s+=3;const o=[];let a=r.length-1;for(let n=0;n<r.length;n++){const e=r[n];if(0!==e){const n=b[a]||"";0===a?o.push(N(e)):(o.push(N(e)),o.push(n))}a--}const u=[];for(let n=0;n<o.length;n++){const e=o[n],t=o[n+1];("ɗaya"!==e||!t||t!==g&&t!==f)&&u.push(e)}const c=[];for(let n=0;n<u.length;n++){const e=u[n],t=n>0?u[n-1]:null;t&&v(e)&&(t===f||t===g||b.includes(t))?c.push(" da "):n>0&&c.push(" "),c.push(e)}return c.join("")}(n)}function v(n){return u.slice(1).includes(n)}const I={haNG:function(n){const t=function(n){const t=typeof n;if("bigint"==typeof n){if(n<=0n)throw new RangeError("Ordinals must be positive integers");return n}if("number"==typeof n){if(!Number.isFinite(n))throw new RangeError("Ordinals must be finite numbers");if(!Number.isInteger(n))throw new RangeError("Ordinals must be whole numbers");if(n<=0)throw new RangeError("Ordinals must be positive integers");return BigInt(n)}if("string"==typeof n)return function(n){const t=n.trim();if(0===t.length)throw new RangeError("Ordinals cannot be empty strings");if("-"===t[0])throw new RangeError("Ordinals cannot be negative");if(t.includes("."))throw new RangeError("Ordinals must be whole numbers");if(r(t)){const n=e(t);if(n.includes("."))throw new RangeError("Ordinals must be whole numbers");const r=BigInt(n);if(r<=0n)throw new RangeError("Ordinals must be positive integers");return r}try{const n=BigInt(t);if(n<=0n)throw new RangeError("Ordinals must be positive integers");return n}catch(e){if(e instanceof RangeError)throw e;throw new RangeError(`Invalid ordinal format: "${n}"`,{cause:e})}}(n);throw new TypeError(`Invalid value type: expected number, string, or bigint, received ${t}`)}(n);return o(t,m),1n===(i=t)?"na farko":"na "+y(i);var i}};n.currency={haNG:function(n){const{isNegative:e,dollars:r,cents:i}=function(n){const e=typeof n;if("bigint"==typeof n)return n<0n?{isNegative:!0,dollars:-n,cents:0n}:{isNegative:!1,dollars:n,cents:0n};if("number"==typeof n){if(!Number.isFinite(n))throw new RangeError("Currency must be a finite number");return Number.isSafeInteger(n)?n<0?{isNegative:!0,dollars:BigInt(-n),cents:0n}:{isNegative:!1,dollars:BigInt(n),cents:0n}:s(t(n))}if("string"==typeof n)return s(n);throw new TypeError(`Invalid value type: expected number, string, or bigint, received ${e}`)}(n);o(r,w);let a="";return e&&(a=d+" "),(r>0n||0n===i)&&(a+=y(r)+" naira"),i>0n&&(r>0n&&(a+=" da "),a+=y(i)+" kobo"),a}},n.haNG=function(n){const{isNegative:s,integerPart:a,decimalPart:c}=function(n){const s=typeof n;if("bigint"==typeof n)return n<0n?{isNegative:!0,integerPart:-n}:{isNegative:!1,integerPart:n};if("number"==typeof n){if(!Number.isFinite(n))throw new RangeError("Number must be finite (NaN and Infinity are not supported)");return Number.isSafeInteger(n)?n<0?{isNegative:!0,integerPart:BigInt(-n)}:{isNegative:!1,integerPart:BigInt(n)}:i(t(n))}if("string"==typeof n)return i(function(n){const t=n.trim();if(0===t.length||Number.isNaN(Number(t)))throw new RangeError(`Invalid number format: "${n}"`);return r(t)?e(t):t}(n));throw new TypeError(`Invalid value type: expected number, string, or bigint, received ${s}`)}(n);o(a,p);let l="";return s&&(l=d+" "),l+=y(a),c&&(l+=" digo "+function(n){const e=[];for(const t of n){const n=parseInt(t,10);e.push(0===n?h:u[n])}return e.join(" ")}(c)),l},n.ordinal=I},"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((n="undefined"!=typeof globalThis?globalThis:n||self).n2words=n.n2words||{});
package/dist/hbo-IL.js CHANGED
@@ -1,2 +1,2 @@
1
- /*! n2words/hbo-IL v5.1.0 | MIT License | github.com/forzagreen/n2words */
1
+ /*! n2words/hbo-IL v5.1.1 | MIT License | github.com/forzagreen/n2words */
2
2
  function e(e){let[n,t]=e.toLowerCase().split("e");const r=parseInt(t,10);let i="";"-"===n[0]&&(i="-",n=n.slice(1));const o=n.indexOf("."),s=-1===o?n:n.slice(0,o)+n.slice(o+1),u=(-1===o?n.length:o)+r;return u>=s.length?i+s+"0".repeat(u-s.length):u<=0?i+"0."+"0".repeat(-u)+s:i+s.slice(0,u)+"."+s.slice(u)}function n(n){const r=n.toString();return t(r)?e(r):r}function t(e){return e.includes("e")||e.includes("E")}function r(e){const n="-"===e[0];n&&(e=e.slice(1));const t=e.indexOf(".");if(-1===t)return{isNegative:n,integerPart:BigInt(e)};const r=e.slice(0,t)||"0",i=e.slice(t+1);return{isNegative:n,integerPart:BigInt(r),decimalPart:i}}function i(n){let r=n.trim();if(0===r.length||Number.isNaN(Number(r)))throw new RangeError(`Invalid currency format: "${n}"`);t(r)&&(r=e(r));const i="-"===r[0];i&&(r=r.slice(1));const o=r.indexOf(".");if(-1===o)return{isNegative:i,dollars:BigInt(r),cents:0n};const s=r.slice(0,o)||"0",u=(r.slice(o+1)+"00").slice(0,2);return{isNegative:i,dollars:BigInt(s),cents:BigInt(u)}}function o(e,n,t){if(null===n)return;if(e<n)return;const r=n.toString().length-1,i=n===10n**BigInt(r)?`10^${r} - 1`:""+(n-1n);throw new RangeError(`Number too large to convert: the largest supported value is ${i}`)}function s(e){return 10n**BigInt(3*(e+1))}const u=["","אחד","שניים","שלשה","ארבעה","חמשה","ששה","שבעה","שמונה","תשעה"],c=["עשרה","אחד עשר","שנים עשר","שלשה עשר","ארבעה עשר","חמשה עשר","ששה עשר","שבעה עשר","שמונה עשר","תשעה עשר"],f=["","אלף","אלפיים","שלשה אלפים","ארבעה אלפים","חמשה אלפים","ששה אלפים","שבעה אלפים","שמונה אלפים","תשעה אלפים"],a=["","אחת","שתים","שלש","ארבע","חמש","שש","שבע","שמונה","תשע"],l=["עשר","אחת עשרה","שתים עשרה","שלש עשרה","ארבע עשרה","חמש עשרה","שש עשרה","שבע עשרה","שמונה עשרה","תשע עשרה"],g=["","אלף","אלפיים","שלשת אלפים","ארבעת אלפים","חמשת אלפים","ששת אלפים","שבעת אלפים","שמונת אלפים","תשעת אלפים"],p=["","","עשרים","שלשים","ארבעים","חמישים","ששים","שבעים","שמונים","תשעים"],b=["","מאה","מאתיים","שלשה מאות","ארבעה מאות","חמשה מאות","ששה מאות","שבעה מאות","שמונה מאות","תשעה מאות"],m=["","מאה","מאתיים","שלש מאות","ארבע מאות","חמש מאות","שש מאות","שבע מאות","שמונה מאות","תשע מאות"],d=["","אלף","מיליון","מיליארד","טריליון","קוודרליון","קווינטיליון"],h=["","אלפים","מיליונים","מיליארדים","טריליונים","קוודרליונים","קווינטיליונים"],w=s(d.length-1),N=10n**BigInt(9),v=s(d.length-1),y="מינוס",I=["","ראשון","שני","שלישי","רביעי","חמישי","שישי","שביעי","שמיני","תשיעי"],E=["עשירי","אחד עשר","שנים עשר","שלשה עשר","ארבעה עשר","חמשה עשר","ששה עשר","שבעה עשר","שמונה עשר","תשעה עשר"],O=["","","עשרים","שלשים","ארבעים","חמישים","ששים","שבעים","שמונים","תשעים"],R="שקלים";function $(e,n,t,r,i){if(0===e)return"";const o=e%10,s=Math.trunc(e/10)%10,u=Math.trunc(e/100);let c="";if(u>0&&(c=i[u]),1===s){const e=r[o];c?c+=" "+n+e:c=e}else s>=2&&(c?c+=" "+n+p[s]:c=p[s]),o>0&&(c?c+=" "+n+t[o]:c=t[o]);return c}function B(e,n,t,r,i){if(0===e)return"";const o=e%10,s=Math.trunc(e/10)%10,u=Math.trunc(e/100);let c="";return u>0&&(c=i[u]),1===s?c?c+=" "+r[o]:c=r[o]:(s>=2&&(c?c+=" "+p[s]:c=p[s]),o>0&&(c?c+=" "+n+t[o]:c=t[o])),c}function j(e,n,t){if(0n===e)return"אפס";const r="feminine"===n,i=r?a:u,o=r?l:c,s=r?g:f,p=r?m:b;if(e<1000n)return B(Number(e),t,i,o,p);const w=[];let N=e;for(;N>0n;)w.push(Number(N%1000n)),N/=1000n;let v="";for(let e=w.length-1;e>=0;e--){const n=w[e];if(0!==n)if(0===e){const e=B(n,t,i,o,p);v?v+=n<=9?" "+t+e:" "+e:v=e}else 1===e?n<=9?(v&&(v+=" "),v+=s[n]):(v&&(v+=" "),v+=$(n,t,i,o,p)+" "+d[1]):1===n?(v&&(v+=" "),v+=d[e]):(v&&(v+=" "),v+=$(n,t,i,o,p)+" "+h[e])}return v}const P={gender:"masculine",andWord:"ו"},x={gender:["masculine","feminine"]};function M(i,s){const{isNegative:c,integerPart:f,decimalPart:l}=function(i){const o=typeof i;if("bigint"==typeof i)return i<0n?{isNegative:!0,integerPart:-i}:{isNegative:!1,integerPart:i};if("number"==typeof i){if(!Number.isFinite(i))throw new RangeError("Number must be finite (NaN and Infinity are not supported)");return Number.isSafeInteger(i)?i<0?{isNegative:!0,integerPart:BigInt(-i)}:{isNegative:!1,integerPart:BigInt(i)}:r(n(i))}if("string"==typeof i)return r(function(n){const r=n.trim();if(0===r.length||Number.isNaN(Number(r)))throw new RangeError(`Invalid number format: "${n}"`);return t(r)?e(r):r}(i));throw new TypeError(`Invalid value type: expected number, string, or bigint, received ${o}`)}(i);o(f,w);const{gender:g,andWord:p}=function(e,n,t){const r={...n};if(void 0===e)return r;if(!function(e){if(null===e||"object"!=typeof e)return!1;const n=Object.getPrototypeOf(e);return null===n||n===Object.prototype}(e))throw new TypeError("Invalid options: expected plain object or undefined, got "+typeof e);const i=Object.keys(n);for(const[o,s]of Object.entries(e)){if(!Object.hasOwn(n,o))throw new TypeError(`Unknown option "${o}" — expected one of: ${i.join(", ")}`);if(void 0!==s){if(typeof s!=typeof r[o])throw new TypeError(`Option "${o}" must be a ${typeof r[o]}, got ${typeof s}`);if(void 0!==t&&Object.hasOwn(t,o)){const e=t[o];if(!e.includes(s))throw new RangeError(`Option "${o}" must be one of: ${e.join(", ")} — got ${JSON.stringify(s)}`)}r[o]=s}}return r}(s,P,x);let b="";return c&&(b=y+" "),b+=j(f,g,p),l&&(b+=" נקודה "+function(e,n){const t="feminine"===n?a:u;let r="";for(let n=0;n<e.length;n++){const i=parseInt(e[n],10);r&&(r+=" "),r+=0===i?"אפס":t[i]}return r}(l,g)),b}function T(e){if(0===e)return"";if(e<10)return I[e];if(e<20)return E[e-10];const n=e%10,t=Math.trunc(e/10);return 0===n?O[t]+" ו"+I[1]:O[t]+" ו"+I[n]}function S(e){if(0n===e)return"";if(1n===e)return I[1];if(e<100n)return T(Number(e));if(e<1000n){const n=Number(e/100n),t=Number(e%100n);return 0===t?"מאה":b[n]+" "+T(t)}if(e<1000000n){const n=Number(e/1000n),t=Number(e%1000n);if(0===t)return n<=9?f[n]:$(n,"ו",u,c,b)+" "+d[1];let r;if(r=n<=9?f[n]:$(n,"ו",u,c,b)+" "+d[1],t<100)return r+" "+T(t);const i=Math.trunc(t/100),o=t%100;return 0===o?r+" "+b[i]:r+" "+b[i]+" "+T(o)}const n=Number(e/1000000n),t=e%1000000n;if(0n===t)return 1===n?d[2]:$(n,"ו",u,c,b)+" "+h[2];let r;return r=1===n?d[2]:$(n,"ו",u,c,b)+" "+h[2],r+" "+S(t)}function F(n){const r=function(n){const r=typeof n;if("bigint"==typeof n){if(n<=0n)throw new RangeError("Ordinals must be positive integers");return n}if("number"==typeof n){if(!Number.isFinite(n))throw new RangeError("Ordinals must be finite numbers");if(!Number.isInteger(n))throw new RangeError("Ordinals must be whole numbers");if(n<=0)throw new RangeError("Ordinals must be positive integers");return BigInt(n)}if("string"==typeof n)return function(n){const r=n.trim();if(0===r.length)throw new RangeError("Ordinals cannot be empty strings");if("-"===r[0])throw new RangeError("Ordinals cannot be negative");if(r.includes("."))throw new RangeError("Ordinals must be whole numbers");if(t(r)){const n=e(r);if(n.includes("."))throw new RangeError("Ordinals must be whole numbers");const t=BigInt(n);if(t<=0n)throw new RangeError("Ordinals must be positive integers");return t}try{const e=BigInt(r);if(e<=0n)throw new RangeError("Ordinals must be positive integers");return e}catch(e){if(e instanceof RangeError)throw e;throw new RangeError(`Invalid ordinal format: "${n}"`,{cause:e})}}(n);throw new TypeError(`Invalid value type: expected number, string, or bigint, received ${r}`)}(n);return o(r,N),S(r)}function k(e){const{isNegative:t,dollars:r,cents:s}=function(e){const t=typeof e;if("bigint"==typeof e)return e<0n?{isNegative:!0,dollars:-e,cents:0n}:{isNegative:!1,dollars:e,cents:0n};if("number"==typeof e){if(!Number.isFinite(e))throw new RangeError("Currency must be a finite number");return Number.isSafeInteger(e)?e<0?{isNegative:!0,dollars:BigInt(-e),cents:0n}:{isNegative:!1,dollars:BigInt(e),cents:0n}:i(n(e))}if("string"==typeof e)return i(e);throw new TypeError(`Invalid value type: expected number, string, or bigint, received ${t}`)}(e);o(r,v);const c=[];if(t&&c.push(y),r>0n||0n===s)if(1n===r)c.push("שקל "+u[1]);else if(2n===r)c.push(u[2]+" "+R);else{const e=j(r,"masculine","ו");c.push(e+" "+R)}if(s>0n)if(1===Number(s))c.push("גרה "+a[1]);else{const e=j(s,"feminine","ו");c.push(e+" גרות")}return c.join(" ")}export{P as cardinalDefaults,w as cardinalMax,x as cardinalValues,v as currencyMax,N as ordinalMax,M as toCardinal,k as toCurrency,F as toOrdinal};
@@ -1,2 +1,2 @@
1
- /*! n2words/hbo-IL v5.1.0 | MIT License | github.com/forzagreen/n2words */
1
+ /*! n2words/hbo-IL v5.1.1 | MIT License | github.com/forzagreen/n2words */
2
2
  var e,n;e=this,n=function(e){"use strict";function n(e){let[n,t]=e.toLowerCase().split("e");const r=parseInt(t,10);let i="";"-"===n[0]&&(i="-",n=n.slice(1));const o=n.indexOf("."),s=-1===o?n:n.slice(0,o)+n.slice(o+1),u=(-1===o?n.length:o)+r;return u>=s.length?i+s+"0".repeat(u-s.length):u<=0?i+"0."+"0".repeat(-u)+s:i+s.slice(0,u)+"."+s.slice(u)}function t(e){const t=e.toString();return r(t)?n(t):t}function r(e){return e.includes("e")||e.includes("E")}function i(e){const n="-"===e[0];n&&(e=e.slice(1));const t=e.indexOf(".");if(-1===t)return{isNegative:n,integerPart:BigInt(e)};const r=e.slice(0,t)||"0",i=e.slice(t+1);return{isNegative:n,integerPart:BigInt(r),decimalPart:i}}function o(e){let t=e.trim();if(0===t.length||Number.isNaN(Number(t)))throw new RangeError(`Invalid currency format: "${e}"`);r(t)&&(t=n(t));const i="-"===t[0];i&&(t=t.slice(1));const o=t.indexOf(".");if(-1===o)return{isNegative:i,dollars:BigInt(t),cents:0n};const s=t.slice(0,o)||"0",u=(t.slice(o+1)+"00").slice(0,2);return{isNegative:i,dollars:BigInt(s),cents:BigInt(u)}}function s(e,n,t){if(null===n)return;if(e<n)return;const r=n.toString().length-1,i=n===10n**BigInt(r)?`10^${r} - 1`:""+(n-1n);throw new RangeError(`Number too large to convert: the largest supported value is ${i}`)}function u(e){return 10n**BigInt(3*(e+1))}const f=["","אחד","שניים","שלשה","ארבעה","חמשה","ששה","שבעה","שמונה","תשעה"],c=["עשרה","אחד עשר","שנים עשר","שלשה עשר","ארבעה עשר","חמשה עשר","ששה עשר","שבעה עשר","שמונה עשר","תשעה עשר"],a=["","אלף","אלפיים","שלשה אלפים","ארבעה אלפים","חמשה אלפים","ששה אלפים","שבעה אלפים","שמונה אלפים","תשעה אלפים"],l=["","אחת","שתים","שלש","ארבע","חמש","שש","שבע","שמונה","תשע"],g=["עשר","אחת עשרה","שתים עשרה","שלש עשרה","ארבע עשרה","חמש עשרה","שש עשרה","שבע עשרה","שמונה עשרה","תשע עשרה"],d=["","אלף","אלפיים","שלשת אלפים","ארבעת אלפים","חמשת אלפים","ששת אלפים","שבעת אלפים","שמונת אלפים","תשעת אלפים"],p=["","","עשרים","שלשים","ארבעים","חמישים","ששים","שבעים","שמונים","תשעים"],b=["","מאה","מאתיים","שלשה מאות","ארבעה מאות","חמשה מאות","ששה מאות","שבעה מאות","שמונה מאות","תשעה מאות"],m=["","מאה","מאתיים","שלש מאות","ארבע מאות","חמש מאות","שש מאות","שבע מאות","שמונה מאות","תשע מאות"],h=["","אלף","מיליון","מיליארד","טריליון","קוודרליון","קווינטיליון"],w=["","אלפים","מיליונים","מיליארדים","טריליונים","קוודרליונים","קווינטיליונים"],N=u(h.length-1),y=10n**BigInt(9),v=u(h.length-1),I="מינוס",E=["","ראשון","שני","שלישי","רביעי","חמישי","שישי","שביעי","שמיני","תשיעי"],O=["עשירי","אחד עשר","שנים עשר","שלשה עשר","ארבעה עשר","חמשה עשר","ששה עשר","שבעה עשר","שמונה עשר","תשעה עשר"],R=["","","עשרים","שלשים","ארבעים","חמישים","ששים","שבעים","שמונים","תשעים"],$="שקלים";function B(e,n,t,r,i){if(0===e)return"";const o=e%10,s=Math.trunc(e/10)%10,u=Math.trunc(e/100);let f="";if(u>0&&(f=i[u]),1===s){const e=r[o];f?f+=" "+n+e:f=e}else s>=2&&(f?f+=" "+n+p[s]:f=p[s]),o>0&&(f?f+=" "+n+t[o]:f=t[o]);return f}function j(e,n,t,r,i){if(0===e)return"";const o=e%10,s=Math.trunc(e/10)%10,u=Math.trunc(e/100);let f="";return u>0&&(f=i[u]),1===s?f?f+=" "+r[o]:f=r[o]:(s>=2&&(f?f+=" "+p[s]:f=p[s]),o>0&&(f?f+=" "+n+t[o]:f=t[o])),f}function x(e,n,t){if(0n===e)return"אפס";const r="feminine"===n,i=r?l:f,o=r?g:c,s=r?d:a,u=r?m:b;if(e<1000n)return j(Number(e),t,i,o,u);const p=[];let N=e;for(;N>0n;)p.push(Number(N%1000n)),N/=1000n;let y="";for(let e=p.length-1;e>=0;e--){const n=p[e];if(0!==n)if(0===e){const e=j(n,t,i,o,u);y?y+=n<=9?" "+t+e:" "+e:y=e}else 1===e?n<=9?(y&&(y+=" "),y+=s[n]):(y&&(y+=" "),y+=B(n,t,i,o,u)+" "+h[1]):1===n?(y&&(y+=" "),y+=h[e]):(y&&(y+=" "),y+=B(n,t,i,o,u)+" "+w[e])}return y}const P={gender:"masculine",andWord:"ו"},T={gender:["masculine","feminine"]};function M(e){if(0===e)return"";if(e<10)return E[e];if(e<20)return O[e-10];const n=e%10,t=Math.trunc(e/10);return 0===n?R[t]+" ו"+E[1]:R[t]+" ו"+E[n]}function S(e){if(0n===e)return"";if(1n===e)return E[1];if(e<100n)return M(Number(e));if(e<1000n){const n=Number(e/100n),t=Number(e%100n);return 0===t?"מאה":b[n]+" "+M(t)}if(e<1000000n){const n=Number(e/1000n),t=Number(e%1000n);if(0===t)return n<=9?a[n]:B(n,"ו",f,c,b)+" "+h[1];let r;if(r=n<=9?a[n]:B(n,"ו",f,c,b)+" "+h[1],t<100)return r+" "+M(t);const i=Math.trunc(t/100),o=t%100;return 0===o?r+" "+b[i]:r+" "+b[i]+" "+M(o)}const n=Number(e/1000000n),t=e%1000000n;if(0n===t)return 1===n?h[2]:B(n,"ו",f,c,b)+" "+w[2];let r;return r=1===n?h[2]:B(n,"ו",f,c,b)+" "+w[2],r+" "+S(t)}const L={hboIL:function(e){const t=function(e){const t=typeof e;if("bigint"==typeof e){if(e<=0n)throw new RangeError("Ordinals must be positive integers");return e}if("number"==typeof e){if(!Number.isFinite(e))throw new RangeError("Ordinals must be finite numbers");if(!Number.isInteger(e))throw new RangeError("Ordinals must be whole numbers");if(e<=0)throw new RangeError("Ordinals must be positive integers");return BigInt(e)}if("string"==typeof e)return function(e){const t=e.trim();if(0===t.length)throw new RangeError("Ordinals cannot be empty strings");if("-"===t[0])throw new RangeError("Ordinals cannot be negative");if(t.includes("."))throw new RangeError("Ordinals must be whole numbers");if(r(t)){const e=n(t);if(e.includes("."))throw new RangeError("Ordinals must be whole numbers");const r=BigInt(e);if(r<=0n)throw new RangeError("Ordinals must be positive integers");return r}try{const e=BigInt(t);if(e<=0n)throw new RangeError("Ordinals must be positive integers");return e}catch(n){if(n instanceof RangeError)throw n;throw new RangeError(`Invalid ordinal format: "${e}"`,{cause:n})}}(e);throw new TypeError(`Invalid value type: expected number, string, or bigint, received ${t}`)}(e);return s(t,y),S(t)}};e.currency={hboIL:function(e){const{isNegative:n,dollars:r,cents:i}=function(e){const n=typeof e;if("bigint"==typeof e)return e<0n?{isNegative:!0,dollars:-e,cents:0n}:{isNegative:!1,dollars:e,cents:0n};if("number"==typeof e){if(!Number.isFinite(e))throw new RangeError("Currency must be a finite number");return Number.isSafeInteger(e)?e<0?{isNegative:!0,dollars:BigInt(-e),cents:0n}:{isNegative:!1,dollars:BigInt(e),cents:0n}:o(t(e))}if("string"==typeof e)return o(e);throw new TypeError(`Invalid value type: expected number, string, or bigint, received ${n}`)}(e);s(r,v);const u=[];if(n&&u.push(I),r>0n||0n===i)if(1n===r)u.push("שקל "+f[1]);else if(2n===r)u.push(f[2]+" "+$);else{const e=x(r,"masculine","ו");u.push(e+" "+$)}if(i>0n)if(1===Number(i))u.push("גרה "+l[1]);else{const e=x(i,"feminine","ו");u.push(e+" גרות")}return u.join(" ")}},e.hboIL=function(e,o){const{isNegative:u,integerPart:c,decimalPart:a}=function(e){const o=typeof e;if("bigint"==typeof e)return e<0n?{isNegative:!0,integerPart:-e}:{isNegative:!1,integerPart:e};if("number"==typeof e){if(!Number.isFinite(e))throw new RangeError("Number must be finite (NaN and Infinity are not supported)");return Number.isSafeInteger(e)?e<0?{isNegative:!0,integerPart:BigInt(-e)}:{isNegative:!1,integerPart:BigInt(e)}:i(t(e))}if("string"==typeof e)return i(function(e){const t=e.trim();if(0===t.length||Number.isNaN(Number(t)))throw new RangeError(`Invalid number format: "${e}"`);return r(t)?n(t):t}(e));throw new TypeError(`Invalid value type: expected number, string, or bigint, received ${o}`)}(e);s(c,N);const{gender:g,andWord:d}=function(e,n,t){const r={...n};if(void 0===e)return r;if(!function(e){if(null===e||"object"!=typeof e)return!1;const n=Object.getPrototypeOf(e);return null===n||n===Object.prototype}(e))throw new TypeError("Invalid options: expected plain object or undefined, got "+typeof e);const i=Object.keys(n);for(const[o,s]of Object.entries(e)){if(!Object.hasOwn(n,o))throw new TypeError(`Unknown option "${o}" — expected one of: ${i.join(", ")}`);if(void 0!==s){if(typeof s!=typeof r[o])throw new TypeError(`Option "${o}" must be a ${typeof r[o]}, got ${typeof s}`);if(void 0!==t&&Object.hasOwn(t,o)){const e=t[o];if(!e.includes(s))throw new RangeError(`Option "${o}" must be one of: ${e.join(", ")} — got ${JSON.stringify(s)}`)}r[o]=s}}return r}(o,P,T);let p="";return u&&(p=I+" "),p+=x(c,g,d),a&&(p+=" נקודה "+function(e,n){const t="feminine"===n?l:f;let r="";for(let n=0;n<e.length;n++){const i=parseInt(e[n],10);r&&(r+=" "),r+=0===i?"אפס":t[i]}return r}(a,g)),p},e.ordinal=L},"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((e="undefined"!=typeof globalThis?globalThis:e||self).n2words=e.n2words||{});
package/dist/he-IL.js CHANGED
@@ -1,2 +1,2 @@
1
- /*! n2words/he-IL v5.1.0 | MIT License | github.com/forzagreen/n2words */
1
+ /*! n2words/he-IL v5.1.1 | MIT License | github.com/forzagreen/n2words */
2
2
  function e(e){let[n,t]=e.toLowerCase().split("e");const r=parseInt(t,10);let i="";"-"===n[0]&&(i="-",n=n.slice(1));const o=n.indexOf("."),s=-1===o?n:n.slice(0,o)+n.slice(o+1),u=(-1===o?n.length:o)+r;return u>=s.length?i+s+"0".repeat(u-s.length):u<=0?i+"0."+"0".repeat(-u)+s:i+s.slice(0,u)+"."+s.slice(u)}function n(n){const r=n.toString();return t(r)?e(r):r}function t(e){return e.includes("e")||e.includes("E")}function r(e){const n="-"===e[0];n&&(e=e.slice(1));const t=e.indexOf(".");if(-1===t)return{isNegative:n,integerPart:BigInt(e)};const r=e.slice(0,t)||"0",i=e.slice(t+1);return{isNegative:n,integerPart:BigInt(r),decimalPart:i}}function i(n){let r=n.trim();if(0===r.length||Number.isNaN(Number(r)))throw new RangeError(`Invalid currency format: "${n}"`);t(r)&&(r=e(r));const i="-"===r[0];i&&(r=r.slice(1));const o=r.indexOf(".");if(-1===o)return{isNegative:i,dollars:BigInt(r),cents:0n};const s=r.slice(0,o)||"0",u=(r.slice(o+1)+"00").slice(0,2);return{isNegative:i,dollars:BigInt(s),cents:BigInt(u)}}function o(e,n,t){if(null===n)return;if(e<n)return;const r=n.toString().length-1,i=n===10n**BigInt(r)?`10^${r} - 1`:""+(n-1n);throw new RangeError(`Number too large to convert: the largest supported value is ${i}`)}function s(e){return 10n**BigInt(3*(e+1))}const u=["","אחת","שתים","שלש","ארבע","חמש","שש","שבע","שמונה","תשע"],c=["עשר","אחת עשרה","שתים עשרה","שלש עשרה","ארבע עשרה","חמש עשרה","שש עשרה","שבע עשרה","שמונה עשרה","תשע עשרה"],f=["","","עשרים","שלשים","ארבעים","חמישים","ששים","שבעים","שמונים","תשעים"],a=["","מאה","מאתיים","שלש מאות","ארבע מאות","חמש מאות","שש מאות","שבע מאות","שמונה מאות","תשע מאות"],l=["","אלף","אלפיים","שלשת אלפים","ארבעת אלפים","חמשת אלפים","ששת אלפים","שבעת אלפים","שמונת אלפים","תשעת אלפים"],g=["","אלף","מיליון","מיליארד","טריליון","קוודרליון","קווינטיליון"],p=["","אלפים","מיליונים","מיליארדים","טריליונים","קוודרליונים","קווינטיליונים"],b=s(g.length-1),h=10n**BigInt(9),m=s(g.length-1),d="אפס",w="מינוס",N=["","אחד","שניים","שלשה","ארבעה","חמשה","ששה","שבעה","שמונה","תשעה"],v=["","ראשון","שני","שלישי","רביעי","חמישי","שישי","שביעי","שמיני","תשיעי"],y=["עשירי","אחד עשר","שנים עשר","שלשה עשר","ארבעה עשר","חמשה עשר","ששה עשר","שבעה עשר","שמונה עשר","תשעה עשר"],I=["","","עשרים","שלשים","ארבעים","חמישים","ששים","שבעים","שמונים","תשעים"],E="שקלים";function O(e,n){if(0===e)return"";const t=e%10,r=Math.trunc(e/10)%10,i=Math.trunc(e/100);let o="";if(i>0&&(o=a[i]),1===r){const e=c[t];o?o+=" "+n+e:o=e}else r>=2&&(o?o+=" "+n+f[r]:o=f[r]),t>0&&(o?o+=" "+n+u[t]:o=u[t]);return o}function R(e,n){if(0===e)return"";const t=e%10,r=Math.trunc(e/10)%10,i=Math.trunc(e/100);let o="";return i>0&&(o=a[i]),1===r?o?o+=" "+c[t]:o=c[t]:(r>=2&&(o?o+=" "+f[r]:o=f[r]),t>0&&(o?o+=" "+n+u[t]:o=u[t])),o}function B(e,n){if(0n===e)return d;if(e<1000n)return R(Number(e),n);const t=[];let r=e;for(;r>0n;)t.push(Number(r%1000n)),r/=1000n;let i="";for(let e=t.length-1;e>=0;e--){const r=t[e];if(0!==r)if(0===e){const e=R(r,n);i?i+=r<=9?" "+n+e:" "+e:i=e}else 1===e?r<=9?(i&&(i+=" "),i+=l[r]):(i&&(i+=" "),i+=O(r,n)+" "+g[1]):1===r?(i&&(i+=" "),i+=g[e]):(i&&(i+=" "),i+=O(r,n)+" "+p[e])}return i}const $={andWord:"ו"};function P(i,s){const{isNegative:c,integerPart:f,decimalPart:a}=function(i){const o=typeof i;if("bigint"==typeof i)return i<0n?{isNegative:!0,integerPart:-i}:{isNegative:!1,integerPart:i};if("number"==typeof i){if(!Number.isFinite(i))throw new RangeError("Number must be finite (NaN and Infinity are not supported)");return Number.isSafeInteger(i)?i<0?{isNegative:!0,integerPart:BigInt(-i)}:{isNegative:!1,integerPart:BigInt(i)}:r(n(i))}if("string"==typeof i)return r(function(n){const r=n.trim();if(0===r.length||Number.isNaN(Number(r)))throw new RangeError(`Invalid number format: "${n}"`);return t(r)?e(r):r}(i));throw new TypeError(`Invalid value type: expected number, string, or bigint, received ${o}`)}(i);o(f,b);const{andWord:l}=function(e,n){const t={...n};if(void 0===e)return t;if(!function(e){if(null===e||"object"!=typeof e)return!1;const n=Object.getPrototypeOf(e);return null===n||n===Object.prototype}(e))throw new TypeError("Invalid options: expected plain object or undefined, got "+typeof e);const r=Object.keys(n);for(const[i,o]of Object.entries(e)){if(!Object.hasOwn(n,i))throw new TypeError(`Unknown option "${i}" — expected one of: ${r.join(", ")}`);if(void 0!==o){if(typeof o!=typeof t[i])throw new TypeError(`Option "${i}" must be a ${typeof t[i]}, got ${typeof o}`);t[i]=o}}return t}(s,$);let g="";return c&&(g=w+" "),g+=B(f,l),a&&(g+=" נקודה "+function(e){let n="";for(let t=0;t<e.length;t++){const r=parseInt(e[t],10);n&&(n+=" "),n+=0===r?d:u[r]}return n}(a)),g}function j(e){if(0===e)return"";if(e<10)return v[e];if(e<20)return y[e-10];const n=e%10,t=Math.trunc(e/10);return 0===n?I[t]+" ו"+v[1]:I[t]+" ו"+v[n]}function x(e){if(0n===e)return"";if(1n===e)return v[1];if(e<100n)return j(Number(e));if(e<1000n){const n=Number(e/100n),t=Number(e%100n);let r;if(1===n){if(0===t)return"מאה";r=a[n]}else{if(0===t)return a[n];r=a[n]}return r+" "+j(t)}if(e<1000000n){const n=Number(e/1000n),t=Number(e%1000n);if(0===t)return n<=9?l[n]:O(n,"ו")+" "+g[1];let r;if(r=n<=9?l[n]:O(n,"ו")+" "+g[1],t<100)return r+" "+j(t);const i=Math.trunc(t/100),o=t%100;return 0===o?r+" "+a[i]:r+" "+a[i]+" "+j(o)}const n=Number(e/1000000n),t=e%1000000n;if(0n===t)return 1===n?g[2]:O(n,"ו")+" "+p[2];let r;return r=1===n?g[2]:O(n,"ו")+" "+p[2],r+" "+x(t)}function M(n){const r=function(n){const r=typeof n;if("bigint"==typeof n){if(n<=0n)throw new RangeError("Ordinals must be positive integers");return n}if("number"==typeof n){if(!Number.isFinite(n))throw new RangeError("Ordinals must be finite numbers");if(!Number.isInteger(n))throw new RangeError("Ordinals must be whole numbers");if(n<=0)throw new RangeError("Ordinals must be positive integers");return BigInt(n)}if("string"==typeof n)return function(n){const r=n.trim();if(0===r.length)throw new RangeError("Ordinals cannot be empty strings");if("-"===r[0])throw new RangeError("Ordinals cannot be negative");if(r.includes("."))throw new RangeError("Ordinals must be whole numbers");if(t(r)){const n=e(r);if(n.includes("."))throw new RangeError("Ordinals must be whole numbers");const t=BigInt(n);if(t<=0n)throw new RangeError("Ordinals must be positive integers");return t}try{const e=BigInt(r);if(e<=0n)throw new RangeError("Ordinals must be positive integers");return e}catch(e){if(e instanceof RangeError)throw e;throw new RangeError(`Invalid ordinal format: "${n}"`,{cause:e})}}(n);throw new TypeError(`Invalid value type: expected number, string, or bigint, received ${r}`)}(n);return o(r,h),x(r)}function T(e){const{isNegative:t,dollars:r,cents:s}=function(e){const t=typeof e;if("bigint"==typeof e)return e<0n?{isNegative:!0,dollars:-e,cents:0n}:{isNegative:!1,dollars:e,cents:0n};if("number"==typeof e){if(!Number.isFinite(e))throw new RangeError("Currency must be a finite number");return Number.isSafeInteger(e)?e<0?{isNegative:!0,dollars:BigInt(-e),cents:0n}:{isNegative:!1,dollars:BigInt(e),cents:0n}:i(n(e))}if("string"==typeof e)return i(e);throw new TypeError(`Invalid value type: expected number, string, or bigint, received ${t}`)}(e);o(r,m);const l=[];if(t&&l.push(w),r>0n||0n===s)if(1n===r)l.push("שקל "+N[1]);else if(2n===r)l.push(N[2]+" "+E);else{const e=0n===(g=r)?d:g<1000n?function(e){if(0===e)return"";const n=e%10,t=Math.trunc(e/10)%10,r=Math.trunc(e/100);let i="";if(r>0&&(i=a[r]),1===t){const e=c[n];i?i+=" "+e:i=e}else t>=2&&(i?i+=" "+f[t]:i=f[t]),n>0&&(i?i+=" ו"+N[n]:i=N[n]);return i}(Number(g)):B(g,"ו");l.push(e+" "+E)}var g;if(s>0n)if(1===Number(s))l.push("אגורה "+u[1]);else{const e=B(s,"ו");l.push(e+" אגורות")}return l.join(" ")}export{$ as cardinalDefaults,b as cardinalMax,m as currencyMax,h as ordinalMax,P as toCardinal,T as toCurrency,M as toOrdinal};
package/dist/he-IL.umd.js CHANGED
@@ -1,2 +1,2 @@
1
- /*! n2words/he-IL v5.1.0 | MIT License | github.com/forzagreen/n2words */
1
+ /*! n2words/he-IL v5.1.1 | MIT License | github.com/forzagreen/n2words */
2
2
  var e,n;e=this,n=function(e){"use strict";function n(e){let[n,t]=e.toLowerCase().split("e");const r=parseInt(t,10);let i="";"-"===n[0]&&(i="-",n=n.slice(1));const o=n.indexOf("."),s=-1===o?n:n.slice(0,o)+n.slice(o+1),u=(-1===o?n.length:o)+r;return u>=s.length?i+s+"0".repeat(u-s.length):u<=0?i+"0."+"0".repeat(-u)+s:i+s.slice(0,u)+"."+s.slice(u)}function t(e){const t=e.toString();return r(t)?n(t):t}function r(e){return e.includes("e")||e.includes("E")}function i(e){const n="-"===e[0];n&&(e=e.slice(1));const t=e.indexOf(".");if(-1===t)return{isNegative:n,integerPart:BigInt(e)};const r=e.slice(0,t)||"0",i=e.slice(t+1);return{isNegative:n,integerPart:BigInt(r),decimalPart:i}}function o(e){let t=e.trim();if(0===t.length||Number.isNaN(Number(t)))throw new RangeError(`Invalid currency format: "${e}"`);r(t)&&(t=n(t));const i="-"===t[0];i&&(t=t.slice(1));const o=t.indexOf(".");if(-1===o)return{isNegative:i,dollars:BigInt(t),cents:0n};const s=t.slice(0,o)||"0",u=(t.slice(o+1)+"00").slice(0,2);return{isNegative:i,dollars:BigInt(s),cents:BigInt(u)}}function s(e,n,t){if(null===n)return;if(e<n)return;const r=n.toString().length-1,i=n===10n**BigInt(r)?`10^${r} - 1`:""+(n-1n);throw new RangeError(`Number too large to convert: the largest supported value is ${i}`)}function u(e){return 10n**BigInt(3*(e+1))}const f=["","אחת","שתים","שלש","ארבע","חמש","שש","שבע","שמונה","תשע"],c=["עשר","אחת עשרה","שתים עשרה","שלש עשרה","ארבע עשרה","חמש עשרה","שש עשרה","שבע עשרה","שמונה עשרה","תשע עשרה"],a=["","","עשרים","שלשים","ארבעים","חמישים","ששים","שבעים","שמונים","תשעים"],l=["","מאה","מאתיים","שלש מאות","ארבע מאות","חמש מאות","שש מאות","שבע מאות","שמונה מאות","תשע מאות"],g=["","אלף","אלפיים","שלשת אלפים","ארבעת אלפים","חמשת אלפים","ששת אלפים","שבעת אלפים","שמונת אלפים","תשעת אלפים"],p=["","אלף","מיליון","מיליארד","טריליון","קוודרליון","קווינטיליון"],d=["","אלפים","מיליונים","מיליארדים","טריליונים","קוודרליונים","קווינטיליונים"],b=u(p.length-1),h=10n**BigInt(9),m=u(p.length-1),w="אפס",N="מינוס",y=["","אחד","שניים","שלשה","ארבעה","חמשה","ששה","שבעה","שמונה","תשעה"],v=["","ראשון","שני","שלישי","רביעי","חמישי","שישי","שביעי","שמיני","תשיעי"],I=["עשירי","אחד עשר","שנים עשר","שלשה עשר","ארבעה עשר","חמשה עשר","ששה עשר","שבעה עשר","שמונה עשר","תשעה עשר"],E=["","","עשרים","שלשים","ארבעים","חמישים","ששים","שבעים","שמונים","תשעים"],O="שקלים";function R(e,n){if(0===e)return"";const t=e%10,r=Math.trunc(e/10)%10,i=Math.trunc(e/100);let o="";if(i>0&&(o=l[i]),1===r){const e=c[t];o?o+=" "+n+e:o=e}else r>=2&&(o?o+=" "+n+a[r]:o=a[r]),t>0&&(o?o+=" "+n+f[t]:o=f[t]);return o}function B(e,n){if(0===e)return"";const t=e%10,r=Math.trunc(e/10)%10,i=Math.trunc(e/100);let o="";return i>0&&(o=l[i]),1===r?o?o+=" "+c[t]:o=c[t]:(r>=2&&(o?o+=" "+a[r]:o=a[r]),t>0&&(o?o+=" "+n+f[t]:o=f[t])),o}function $(e,n){if(0n===e)return w;if(e<1000n)return B(Number(e),n);const t=[];let r=e;for(;r>0n;)t.push(Number(r%1000n)),r/=1000n;let i="";for(let e=t.length-1;e>=0;e--){const r=t[e];if(0!==r)if(0===e){const e=B(r,n);i?i+=r<=9?" "+n+e:" "+e:i=e}else 1===e?r<=9?(i&&(i+=" "),i+=g[r]):(i&&(i+=" "),i+=R(r,n)+" "+p[1]):1===r?(i&&(i+=" "),i+=p[e]):(i&&(i+=" "),i+=R(r,n)+" "+d[e])}return i}const x={andWord:"ו"};function j(e){if(0===e)return"";if(e<10)return v[e];if(e<20)return I[e-10];const n=e%10,t=Math.trunc(e/10);return 0===n?E[t]+" ו"+v[1]:E[t]+" ו"+v[n]}function P(e){if(0n===e)return"";if(1n===e)return v[1];if(e<100n)return j(Number(e));if(e<1000n){const n=Number(e/100n),t=Number(e%100n);let r;if(1===n){if(0===t)return"מאה";r=l[n]}else{if(0===t)return l[n];r=l[n]}return r+" "+j(t)}if(e<1000000n){const n=Number(e/1000n),t=Number(e%1000n);if(0===t)return n<=9?g[n]:R(n,"ו")+" "+p[1];let r;if(r=n<=9?g[n]:R(n,"ו")+" "+p[1],t<100)return r+" "+j(t);const i=Math.trunc(t/100),o=t%100;return 0===o?r+" "+l[i]:r+" "+l[i]+" "+j(o)}const n=Number(e/1000000n),t=e%1000000n;if(0n===t)return 1===n?p[2]:R(n,"ו")+" "+d[2];let r;return r=1===n?p[2]:R(n,"ו")+" "+d[2],r+" "+P(t)}const M={heIL:function(e){const t=function(e){const t=typeof e;if("bigint"==typeof e){if(e<=0n)throw new RangeError("Ordinals must be positive integers");return e}if("number"==typeof e){if(!Number.isFinite(e))throw new RangeError("Ordinals must be finite numbers");if(!Number.isInteger(e))throw new RangeError("Ordinals must be whole numbers");if(e<=0)throw new RangeError("Ordinals must be positive integers");return BigInt(e)}if("string"==typeof e)return function(e){const t=e.trim();if(0===t.length)throw new RangeError("Ordinals cannot be empty strings");if("-"===t[0])throw new RangeError("Ordinals cannot be negative");if(t.includes("."))throw new RangeError("Ordinals must be whole numbers");if(r(t)){const e=n(t);if(e.includes("."))throw new RangeError("Ordinals must be whole numbers");const r=BigInt(e);if(r<=0n)throw new RangeError("Ordinals must be positive integers");return r}try{const e=BigInt(t);if(e<=0n)throw new RangeError("Ordinals must be positive integers");return e}catch(n){if(n instanceof RangeError)throw n;throw new RangeError(`Invalid ordinal format: "${e}"`,{cause:n})}}(e);throw new TypeError(`Invalid value type: expected number, string, or bigint, received ${t}`)}(e);return s(t,h),P(t)}};e.currency={heIL:function(e){const{isNegative:n,dollars:r,cents:i}=function(e){const n=typeof e;if("bigint"==typeof e)return e<0n?{isNegative:!0,dollars:-e,cents:0n}:{isNegative:!1,dollars:e,cents:0n};if("number"==typeof e){if(!Number.isFinite(e))throw new RangeError("Currency must be a finite number");return Number.isSafeInteger(e)?e<0?{isNegative:!0,dollars:BigInt(-e),cents:0n}:{isNegative:!1,dollars:BigInt(e),cents:0n}:o(t(e))}if("string"==typeof e)return o(e);throw new TypeError(`Invalid value type: expected number, string, or bigint, received ${n}`)}(e);s(r,m);const u=[];if(n&&u.push(N),r>0n||0n===i)if(1n===r)u.push("שקל "+y[1]);else if(2n===r)u.push(y[2]+" "+O);else{const e=0n===(g=r)?w:g<1000n?function(e){if(0===e)return"";const n=e%10,t=Math.trunc(e/10)%10,r=Math.trunc(e/100);let i="";if(r>0&&(i=l[r]),1===t){const e=c[n];i?i+=" "+e:i=e}else t>=2&&(i?i+=" "+a[t]:i=a[t]),n>0&&(i?i+=" ו"+y[n]:i=y[n]);return i}(Number(g)):$(g,"ו");u.push(e+" "+O)}var g;if(i>0n)if(1===Number(i))u.push("אגורה "+f[1]);else{const e=$(i,"ו");u.push(e+" אגורות")}return u.join(" ")}},e.heIL=function(e,o){const{isNegative:u,integerPart:c,decimalPart:a}=function(e){const o=typeof e;if("bigint"==typeof e)return e<0n?{isNegative:!0,integerPart:-e}:{isNegative:!1,integerPart:e};if("number"==typeof e){if(!Number.isFinite(e))throw new RangeError("Number must be finite (NaN and Infinity are not supported)");return Number.isSafeInteger(e)?e<0?{isNegative:!0,integerPart:BigInt(-e)}:{isNegative:!1,integerPart:BigInt(e)}:i(t(e))}if("string"==typeof e)return i(function(e){const t=e.trim();if(0===t.length||Number.isNaN(Number(t)))throw new RangeError(`Invalid number format: "${e}"`);return r(t)?n(t):t}(e));throw new TypeError(`Invalid value type: expected number, string, or bigint, received ${o}`)}(e);s(c,b);const{andWord:l}=function(e,n){const t={...n};if(void 0===e)return t;if(!function(e){if(null===e||"object"!=typeof e)return!1;const n=Object.getPrototypeOf(e);return null===n||n===Object.prototype}(e))throw new TypeError("Invalid options: expected plain object or undefined, got "+typeof e);const r=Object.keys(n);for(const[i,o]of Object.entries(e)){if(!Object.hasOwn(n,i))throw new TypeError(`Unknown option "${i}" — expected one of: ${r.join(", ")}`);if(void 0!==o){if(typeof o!=typeof t[i])throw new TypeError(`Option "${i}" must be a ${typeof t[i]}, got ${typeof o}`);t[i]=o}}return t}(o,x);let g="";return u&&(g=N+" "),g+=$(c,l),a&&(g+=" נקודה "+function(e){let n="";for(let t=0;t<e.length;t++){const r=parseInt(e[t],10);n&&(n+=" "),n+=0===r?w:f[r]}return n}(a)),g},e.ordinal=M},"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((e="undefined"!=typeof globalThis?globalThis:e||self).n2words=e.n2words||{});
package/dist/hi-IN.js CHANGED
@@ -1,2 +1,2 @@
1
- /*! n2words/hi-IN v5.1.0 | MIT License | github.com/forzagreen/n2words */
1
+ /*! n2words/hi-IN v5.1.1 | MIT License | github.com/forzagreen/n2words */
2
2
  function e(e){let[n,t]=e.toLowerCase().split("e");const r=parseInt(t,10);let i="";"-"===n[0]&&(i="-",n=n.slice(1));const o=n.indexOf("."),s=-1===o?n:n.slice(0,o)+n.slice(o+1),u=(-1===o?n.length:o)+r;return u>=s.length?i+s+"0".repeat(u-s.length):u<=0?i+"0."+"0".repeat(-u)+s:i+s.slice(0,u)+"."+s.slice(u)}function n(n){const r=n.toString();return t(r)?e(r):r}function t(e){return e.includes("e")||e.includes("E")}function r(e){const n="-"===e[0];n&&(e=e.slice(1));const t=e.indexOf(".");if(-1===t)return{isNegative:n,integerPart:BigInt(e)};const r=e.slice(0,t)||"0",i=e.slice(t+1);return{isNegative:n,integerPart:BigInt(r),decimalPart:i}}function i(n){let r=n.trim();if(0===r.length||Number.isNaN(Number(r)))throw new RangeError(`Invalid currency format: "${n}"`);t(r)&&(r=e(r));const i="-"===r[0];i&&(r=r.slice(1));const o=r.indexOf(".");if(-1===o)return{isNegative:i,dollars:BigInt(r),cents:0n};const s=r.slice(0,o)||"0",u=(r.slice(o+1)+"00").slice(0,2);return{isNegative:i,dollars:BigInt(s),cents:BigInt(u)}}function o(e,n,t){if(null===n)return;if(e<n&&!(t&&BigInt(t)>=n))return;const r=n.toString().length-1,i=n===10n**BigInt(r)?`10^${r} - 1`:""+(n-1n);throw new RangeError(`Number too large to convert: the largest supported value is ${i}`)}function s(e){return 10n**BigInt(3+2*(e-1))}const u="शून्य",a="माइनस",g=["","पहला","दूसरा","तीसरा","चौथा","पाँचवाँ","छठा"],c=["शून्य","एक","दो","तीन","चार","पाँच","छह","सात","आठ","नौ","दस","ग्यारह","बारह","तेरह","चौदह","पंद्रह","सोलह","सत्रह","अठारह","उन्नीस","बीस","इक्कीस","बाईस","तेईस","चौबीस","पच्चीस","छब्बीस","सत्ताईस","अट्ठाईस","उनतीस","तीस","इकतीस","बत्तीस","तैंतीस","चौंतीस","पैंतीस","छत्तीस","सैंतीस","अड़तीस","उनतालीस","चालीस","इकतालीस","बयालीस","तेतालीस","चवालीस","पैंतालीस","छियालीस","सैंतालीस","अड़तालीस","उनचास","पचास","इक्यावन","बावन","तिरपन","चौवन","पचपन","छप्पन","सत्तावन","अट्ठावन","उनसठ","साठ","इकसठ","बासठ","तिरसठ","चौंसठ","पैंसठ","छियासठ","सड़सठ","अड़सठ","उनहत्तर","सत्तर","इकहत्तर","बहत्तर","तिहत्तर","चौहत्तर","पचहत्तर","छिहत्तर","सतहत्तर","अठहत्तर","उन्यासी","अस्सी","इक्यासी","बयासी","तिरासी","चौरासी","पचासी","छियासी","सत्तासी","अट्ठासी","नवासी","नब्बे","इक्यानवे","बानवे","तिरानवे","चौरानवे","पचानवे","छियानवे","सत्तानवे","अट्ठानवे","निन्यानवे"],l=["","हज़ार","लाख","करोड़","अरब","खरब","नील","पद्म","शंख"],f=s(l.length),m=s(l.length),b=s(l.length);function w(e){if(0===e)return"";if(e<100)return c[e];const n=Math.trunc(e/100),t=e%100;return 0===t?c[n]+" सौ":c[n]+" सौ "+c[t]}function d(e){if(0n===e)return u;if(e<1000n)return w(Number(e));const n=[];n.push(Number(e%1000n));let t=e/1000n;for(;t>0n;)n.push(Number(t%100n)),t/=100n;const r=[];for(let e=n.length-1;e>=0;e--){const t=n[e];0!==t&&(r.push(0===e?w(t):c[t]),e>0&&l[e]&&r.push(l[e]))}return r.join(" ")}function h(i){const{isNegative:s,integerPart:g,decimalPart:c}=function(i){const o=typeof i;if("bigint"==typeof i)return i<0n?{isNegative:!0,integerPart:-i}:{isNegative:!1,integerPart:i};if("number"==typeof i){if(!Number.isFinite(i))throw new RangeError("Number must be finite (NaN and Infinity are not supported)");return Number.isSafeInteger(i)?i<0?{isNegative:!0,integerPart:BigInt(-i)}:{isNegative:!1,integerPart:BigInt(i)}:r(n(i))}if("string"==typeof i)return r(function(n){const r=n.trim();if(0===r.length||Number.isNaN(Number(r)))throw new RangeError(`Invalid number format: "${n}"`);return t(r)?e(r):r}(i));throw new TypeError(`Invalid value type: expected number, string, or bigint, received ${o}`)}(i);o(g,f,c);let l="";return s&&(l=a+" "),l+=d(g),c&&(l+=" दशमलव "+function(e){let n="",t=0;for(;t<e.length&&"0"===e[t];)n&&(n+=" "),n+=u,t++;const r=e.slice(t);return r&&(n&&(n+=" "),n+=d(BigInt(r))),n}(c)),l}function p(n){const r=function(n){const r=typeof n;if("bigint"==typeof n){if(n<=0n)throw new RangeError("Ordinals must be positive integers");return n}if("number"==typeof n){if(!Number.isFinite(n))throw new RangeError("Ordinals must be finite numbers");if(!Number.isInteger(n))throw new RangeError("Ordinals must be whole numbers");if(n<=0)throw new RangeError("Ordinals must be positive integers");return BigInt(n)}if("string"==typeof n)return function(n){const r=n.trim();if(0===r.length)throw new RangeError("Ordinals cannot be empty strings");if("-"===r[0])throw new RangeError("Ordinals cannot be negative");if(r.includes("."))throw new RangeError("Ordinals must be whole numbers");if(t(r)){const n=e(r);if(n.includes("."))throw new RangeError("Ordinals must be whole numbers");const t=BigInt(n);if(t<=0n)throw new RangeError("Ordinals must be positive integers");return t}try{const e=BigInt(r);if(e<=0n)throw new RangeError("Ordinals must be positive integers");return e}catch(e){if(e instanceof RangeError)throw e;throw new RangeError(`Invalid ordinal format: "${n}"`,{cause:e})}}(n);throw new TypeError(`Invalid value type: expected number, string, or bigint, received ${r}`)}(n);return o(r,m),(i=r)>=1n&&i<=6n?g[Number(i)]:d(i)+"वाँ";var i}function N(e){const{isNegative:t,dollars:r,cents:s}=function(e){const t=typeof e;if("bigint"==typeof e)return e<0n?{isNegative:!0,dollars:-e,cents:0n}:{isNegative:!1,dollars:e,cents:0n};if("number"==typeof e){if(!Number.isFinite(e))throw new RangeError("Currency must be a finite number");return Number.isSafeInteger(e)?e<0?{isNegative:!0,dollars:BigInt(-e),cents:0n}:{isNegative:!1,dollars:BigInt(e),cents:0n}:i(n(e))}if("string"==typeof e)return i(e);throw new TypeError(`Invalid value type: expected number, string, or bigint, received ${t}`)}(e);o(r,b);let u="";return t&&(u=a+" "),(r>0n||0n===s)&&(u+=d(r),u+=" "+(1n===r?"रुपया":"रुपये")),s>0n&&(r>0n&&(u+=" "),u+=d(s),u+=" "+(1n===s?"पैसा":"पैसे")),u}export{f as cardinalMax,b as currencyMax,m as ordinalMax,h as toCardinal,N as toCurrency,p as toOrdinal};
package/dist/hi-IN.umd.js CHANGED
@@ -1,2 +1,2 @@
1
- /*! n2words/hi-IN v5.1.0 | MIT License | github.com/forzagreen/n2words */
1
+ /*! n2words/hi-IN v5.1.1 | MIT License | github.com/forzagreen/n2words */
2
2
  var e,n;e=this,n=function(e){"use strict";function n(e){let[n,t]=e.toLowerCase().split("e");const r=parseInt(t,10);let i="";"-"===n[0]&&(i="-",n=n.slice(1));const o=n.indexOf("."),s=-1===o?n:n.slice(0,o)+n.slice(o+1),u=(-1===o?n.length:o)+r;return u>=s.length?i+s+"0".repeat(u-s.length):u<=0?i+"0."+"0".repeat(-u)+s:i+s.slice(0,u)+"."+s.slice(u)}function t(e){const t=e.toString();return r(t)?n(t):t}function r(e){return e.includes("e")||e.includes("E")}function i(e){const n="-"===e[0];n&&(e=e.slice(1));const t=e.indexOf(".");if(-1===t)return{isNegative:n,integerPart:BigInt(e)};const r=e.slice(0,t)||"0",i=e.slice(t+1);return{isNegative:n,integerPart:BigInt(r),decimalPart:i}}function o(e){let t=e.trim();if(0===t.length||Number.isNaN(Number(t)))throw new RangeError(`Invalid currency format: "${e}"`);r(t)&&(t=n(t));const i="-"===t[0];i&&(t=t.slice(1));const o=t.indexOf(".");if(-1===o)return{isNegative:i,dollars:BigInt(t),cents:0n};const s=t.slice(0,o)||"0",u=(t.slice(o+1)+"00").slice(0,2);return{isNegative:i,dollars:BigInt(s),cents:BigInt(u)}}function s(e,n,t){if(null===n)return;if(e<n&&!(t&&BigInt(t)>=n))return;const r=n.toString().length-1,i=n===10n**BigInt(r)?`10^${r} - 1`:""+(n-1n);throw new RangeError(`Number too large to convert: the largest supported value is ${i}`)}function u(e){return 10n**BigInt(3+2*(e-1))}const a="शून्य",c="माइनस",g=["","पहला","दूसरा","तीसरा","चौथा","पाँचवाँ","छठा"],f=["शून्य","एक","दो","तीन","चार","पाँच","छह","सात","आठ","नौ","दस","ग्यारह","बारह","तेरह","चौदह","पंद्रह","सोलह","सत्रह","अठारह","उन्नीस","बीस","इक्कीस","बाईस","तेईस","चौबीस","पच्चीस","छब्बीस","सत्ताईस","अट्ठाईस","उनतीस","तीस","इकतीस","बत्तीस","तैंतीस","चौंतीस","पैंतीस","छत्तीस","सैंतीस","अड़तीस","उनतालीस","चालीस","इकतालीस","बयालीस","तेतालीस","चवालीस","पैंतालीस","छियालीस","सैंतालीस","अड़तालीस","उनचास","पचास","इक्यावन","बावन","तिरपन","चौवन","पचपन","छप्पन","सत्तावन","अट्ठावन","उनसठ","साठ","इकसठ","बासठ","तिरसठ","चौंसठ","पैंसठ","छियासठ","सड़सठ","अड़सठ","उनहत्तर","सत्तर","इकहत्तर","बहत्तर","तिहत्तर","चौहत्तर","पचहत्तर","छिहत्तर","सतहत्तर","अठहत्तर","उन्यासी","अस्सी","इक्यासी","बयासी","तिरासी","चौरासी","पचासी","छियासी","सत्तासी","अट्ठासी","नवासी","नब्बे","इक्यानवे","बानवे","तिरानवे","चौरानवे","पचानवे","छियानवे","सत्तानवे","अट्ठानवे","निन्यानवे"],l=["","हज़ार","लाख","करोड़","अरब","खरब","नील","पद्म","शंख"],d=u(l.length),b=u(l.length),m=u(l.length);function h(e){if(0===e)return"";if(e<100)return f[e];const n=Math.trunc(e/100),t=e%100;return 0===t?f[n]+" सौ":f[n]+" सौ "+f[t]}function p(e){if(0n===e)return a;if(e<1000n)return h(Number(e));const n=[];n.push(Number(e%1000n));let t=e/1000n;for(;t>0n;)n.push(Number(t%100n)),t/=100n;const r=[];for(let e=n.length-1;e>=0;e--){const t=n[e];0!==t&&(r.push(0===e?h(t):f[t]),e>0&&l[e]&&r.push(l[e]))}return r.join(" ")}const w={hiIN:function(e){const t=function(e){const t=typeof e;if("bigint"==typeof e){if(e<=0n)throw new RangeError("Ordinals must be positive integers");return e}if("number"==typeof e){if(!Number.isFinite(e))throw new RangeError("Ordinals must be finite numbers");if(!Number.isInteger(e))throw new RangeError("Ordinals must be whole numbers");if(e<=0)throw new RangeError("Ordinals must be positive integers");return BigInt(e)}if("string"==typeof e)return function(e){const t=e.trim();if(0===t.length)throw new RangeError("Ordinals cannot be empty strings");if("-"===t[0])throw new RangeError("Ordinals cannot be negative");if(t.includes("."))throw new RangeError("Ordinals must be whole numbers");if(r(t)){const e=n(t);if(e.includes("."))throw new RangeError("Ordinals must be whole numbers");const r=BigInt(e);if(r<=0n)throw new RangeError("Ordinals must be positive integers");return r}try{const e=BigInt(t);if(e<=0n)throw new RangeError("Ordinals must be positive integers");return e}catch(n){if(n instanceof RangeError)throw n;throw new RangeError(`Invalid ordinal format: "${e}"`,{cause:n})}}(e);throw new TypeError(`Invalid value type: expected number, string, or bigint, received ${t}`)}(e);return s(t,b),(i=t)>=1n&&i<=6n?g[Number(i)]:p(i)+"वाँ";var i}};e.currency={hiIN:function(e){const{isNegative:n,dollars:r,cents:i}=function(e){const n=typeof e;if("bigint"==typeof e)return e<0n?{isNegative:!0,dollars:-e,cents:0n}:{isNegative:!1,dollars:e,cents:0n};if("number"==typeof e){if(!Number.isFinite(e))throw new RangeError("Currency must be a finite number");return Number.isSafeInteger(e)?e<0?{isNegative:!0,dollars:BigInt(-e),cents:0n}:{isNegative:!1,dollars:BigInt(e),cents:0n}:o(t(e))}if("string"==typeof e)return o(e);throw new TypeError(`Invalid value type: expected number, string, or bigint, received ${n}`)}(e);s(r,m);let u="";return n&&(u=c+" "),(r>0n||0n===i)&&(u+=p(r),u+=" "+(1n===r?"रुपया":"रुपये")),i>0n&&(r>0n&&(u+=" "),u+=p(i),u+=" "+(1n===i?"पैसा":"पैसे")),u}},e.hiIN=function(e){const{isNegative:o,integerPart:u,decimalPart:g}=function(e){const o=typeof e;if("bigint"==typeof e)return e<0n?{isNegative:!0,integerPart:-e}:{isNegative:!1,integerPart:e};if("number"==typeof e){if(!Number.isFinite(e))throw new RangeError("Number must be finite (NaN and Infinity are not supported)");return Number.isSafeInteger(e)?e<0?{isNegative:!0,integerPart:BigInt(-e)}:{isNegative:!1,integerPart:BigInt(e)}:i(t(e))}if("string"==typeof e)return i(function(e){const t=e.trim();if(0===t.length||Number.isNaN(Number(t)))throw new RangeError(`Invalid number format: "${e}"`);return r(t)?n(t):t}(e));throw new TypeError(`Invalid value type: expected number, string, or bigint, received ${o}`)}(e);s(u,d,g);let f="";return o&&(f=c+" "),f+=p(u),g&&(f+=" दशमलव "+function(e){let n="",t=0;for(;t<e.length&&"0"===e[t];)n&&(n+=" "),n+=a,t++;const r=e.slice(t);return r&&(n&&(n+=" "),n+=p(BigInt(r))),n}(g)),f},e.ordinal=w},"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((e="undefined"!=typeof globalThis?globalThis:e||self).n2words=e.n2words||{});
package/dist/hr-HR.js CHANGED
@@ -1,2 +1,2 @@
1
- /*! n2words/hr-HR v5.1.0 | MIT License | github.com/forzagreen/n2words */
1
+ /*! n2words/hr-HR v5.1.1 | MIT License | github.com/forzagreen/n2words */
2
2
  function e(e){let[t,n]=e.toLowerCase().split("e");const i=parseInt(n,10);let r="";"-"===t[0]&&(r="-",t=t.slice(1));const s=t.indexOf("."),o=-1===s?t:t.slice(0,s)+t.slice(s+1),a=(-1===s?t.length:s)+i;return a>=o.length?r+o+"0".repeat(a-o.length):a<=0?r+"0."+"0".repeat(-a)+o:r+o.slice(0,a)+"."+o.slice(a)}function t(t){const i=t.toString();return n(i)?e(i):i}function n(e){return e.includes("e")||e.includes("E")}function i(e){const t="-"===e[0];t&&(e=e.slice(1));const n=e.indexOf(".");if(-1===n)return{isNegative:t,integerPart:BigInt(e)};const i=e.slice(0,n)||"0",r=e.slice(n+1);return{isNegative:t,integerPart:BigInt(i),decimalPart:r}}function r(t){let i=t.trim();if(0===i.length||Number.isNaN(Number(i)))throw new RangeError(`Invalid currency format: "${t}"`);n(i)&&(i=e(i));const r="-"===i[0];r&&(i=i.slice(1));const s=i.indexOf(".");if(-1===s)return{isNegative:r,dollars:BigInt(i),cents:0n};const o=i.slice(0,s)||"0",a=(i.slice(s+1)+"00").slice(0,2);return{isNegative:r,dollars:BigInt(o),cents:BigInt(a)}}function s(e,t,n){if(null===t)return;if(e<t&&!(n&&BigInt(n)>=t))return;const i=t.toString().length-1,r=t===10n**BigInt(i)?`10^${i} - 1`:""+(t-1n);throw new RangeError(`Number too large to convert: the largest supported value is ${r}`)}function o(e){return 10n**BigInt(3*(e+1))}const a=["","jedan","dva","tri","četiri","pet","šest","sedam","osam","devet"],u=["","jedna","dvije","tri","četiri","pet","šest","sedam","osam","devet"],c=["deset","jedanaest","dvanaest","trinaest","četrnaest","petnaest","šesnaest","sedamnaest","osamnaest","devetnaest"],l=["","","dvadeset","trideset","četrdeset","pedeset","šezdeset","sedamdeset","osamdeset","devedeset"],f=["","sto","dvjesto","tristo","četiristo","petsto","šesto","sedamsto","osamsto","devetsto"],d="nula",g="minus",m=["","prvi","drugi","treći","četvrti","peti","šesti","sedmi","osmi","deveti"],p=["deseti","jedanaesti","dvanaesti","trinaesti","četrnaesti","petnaesti","šesnaesti","sedamnaesti","osamnaesti","devetnaesti"],h=["","","dvadeseti","trideseti","četrdeseti","pedeseti","šezdeseti","sedamdeseti","osamdeseti","devedeseti"],b=["","stoti","dvjestoti","tristoti","četiristoti","petstoti","šeststoti","sedamstoti","osamstoti","devetstoti"],v=["tisućiti","milijunti","milijarditi","bilijunti"],w=["euro","eura","eura"],j=["cent","centa","centi"],N=[["tisuća","tisuće","tisuća"],["milijun","milijuna","milijuna"],["milijarda","milijarde","milijarda"],["bilijun","bilijuna","bilijuna"],["bilijarda","bilijarde","bilijarda"],["trilijun","trilijuna","trilijuna"],["trilijarda","trilijarde","trilijarda"],["kvadrilijun","kvadrilijuna","kvadrilijuna"],["kvadrilijarda","kvadrilijarde","kvadrilijarda"]];function y(e,t){const n="bigint"==typeof e?Number(e):e,i=n%10,r=n%100;return r>=11&&r<=19?t[2]:1===i?t[0]:i>=2&&i<=4?t[1]:t[2]}function I(e){if(0===e)return"";const t=e%10,n=Math.trunc(e/10)%10,i=Math.trunc(e/100),r=[];return i>0&&r.push(f[i]),n>1&&r.push(l[n]),1===n?r.push(c[t]):t>0&&r.push(a[t]),r.join(" ")}function E(e){if(0===e)return"";const t=e%10,n=Math.trunc(e/10)%10,i=Math.trunc(e/100),r=[];return i>0&&r.push(f[i]),n>1&&r.push(l[n]),1===n?r.push(c[t]):t>0&&r.push(u[t]),r.join(" ")}function O(e,t){return 0n===e?d:e<1000n?"feminine"===t?E(Number(e)):I(Number(e)):function(e,t){const n=e.toString(),i=n.length,r=[],s=i%3;let o=0;for(s>0&&(r.push(Number(n.slice(0,s))),o=s);o<i;)r.push(Number(n.slice(o,o+3))),o+=3;const a=[];let u=r.length-1;for(let e=0;e<r.length;e++){const n=r[e];if(0!==n)if(0===u)a.push("feminine"===t?E(n):I(n));else{const e=y(n,N[u-1]),t=1===u?E(n):I(n);a.push(t+" "+e)}u--}return a.join(" ")}(e,t)}const B=o(N.length),R=o(v.length),$=o(N.length),P={gender:"masculine"},x={gender:["masculine","feminine"]};function k(r,o){const{isNegative:a,integerPart:u,decimalPart:c}=function(r){const s=typeof r;if("bigint"==typeof r)return r<0n?{isNegative:!0,integerPart:-r}:{isNegative:!1,integerPart:r};if("number"==typeof r){if(!Number.isFinite(r))throw new RangeError("Number must be finite (NaN and Infinity are not supported)");return Number.isSafeInteger(r)?r<0?{isNegative:!0,integerPart:BigInt(-r)}:{isNegative:!1,integerPart:BigInt(r)}:i(t(r))}if("string"==typeof r)return i(function(t){const i=t.trim();if(0===i.length||Number.isNaN(Number(i)))throw new RangeError(`Invalid number format: "${t}"`);return n(i)?e(i):i}(r));throw new TypeError(`Invalid value type: expected number, string, or bigint, received ${s}`)}(r);s(u,B,c);const{gender:l}=function(e,t,n){const i={...t};if(void 0===e)return i;if(!function(e){if(null===e||"object"!=typeof e)return!1;const t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}(e))throw new TypeError("Invalid options: expected plain object or undefined, got "+typeof e);const r=Object.keys(t);for(const[s,o]of Object.entries(e)){if(!Object.hasOwn(t,s))throw new TypeError(`Unknown option "${s}" — expected one of: ${r.join(", ")}`);if(void 0!==o){if(typeof o!=typeof i[s])throw new TypeError(`Option "${s}" must be a ${typeof i[s]}, got ${typeof o}`);if(void 0!==n&&Object.hasOwn(n,s)){const e=n[s];if(!e.includes(o))throw new RangeError(`Option "${s}" must be one of: ${e.join(", ")} — got ${JSON.stringify(o)}`)}i[s]=o}}return i}(o,P,x);let f="";return a&&(f=g+" "),f+=O(u,l),c&&(f+=" zarez "+function(e,t){let n="",i=0;for(;i<e.length&&"0"===e[i];)n&&(n+=" "),n+=d,i++;const r=e.slice(i);return r&&(n&&(n+=" "),n+=O(BigInt(r),t)),n}(c,l)),f}function S(e){if(0===e)return"";const t=e%10,n=Math.trunc(e/10);return 0===n?m[t]:1===n?p[t]:0===t?h[n]:l[n]+" "+m[t]}function M(e){if(e<100n)return S(Number(e));if(e<1000n){const t=Number(e),n=Math.trunc(t/100),i=t%100;return 0===i?b[n]:f[n]+" "+S(i)}if(e<1000000n){const t=Number(e/1000n),n=Number(e%1000n);if(0===n)return 1===t?v[0]:E(t)+" "+v[0];const i=y(t,N[0]);return E(t)+" "+i+" "+M(BigInt(n))}return function(e){const t=e.toString(),n=t.length,i=[],r=n%3;let s=0;for(r>0&&(i.push(Number(t.slice(0,r))),s=r);s<n;)i.push(Number(t.slice(s,s+3))),s+=3;let o=i.length-1;for(;o>=0&&0===i[o];)o--;const a=[];let u=i.length-1;for(let e=0;e<i.length;e++){const t=i[e];if(0!==t){const n=e===o;if(0===u)a.push(n?M(BigInt(t)):I(t));else if(n)if(1===t)a.push(v[u-1]);else{const e=1===u?E(t):I(t);a.push(e+" "+v[u-1])}else{const e=y(t,N[u-1]),n=1===u?E(t):I(t);a.push(n+" "+e)}}u--}return a.join(" ")}(e)}function T(t){const i=function(t){const i=typeof t;if("bigint"==typeof t){if(t<=0n)throw new RangeError("Ordinals must be positive integers");return t}if("number"==typeof t){if(!Number.isFinite(t))throw new RangeError("Ordinals must be finite numbers");if(!Number.isInteger(t))throw new RangeError("Ordinals must be whole numbers");if(t<=0)throw new RangeError("Ordinals must be positive integers");return BigInt(t)}if("string"==typeof t)return function(t){const i=t.trim();if(0===i.length)throw new RangeError("Ordinals cannot be empty strings");if("-"===i[0])throw new RangeError("Ordinals cannot be negative");if(i.includes("."))throw new RangeError("Ordinals must be whole numbers");if(n(i)){const t=e(i);if(t.includes("."))throw new RangeError("Ordinals must be whole numbers");const n=BigInt(t);if(n<=0n)throw new RangeError("Ordinals must be positive integers");return n}try{const e=BigInt(i);if(e<=0n)throw new RangeError("Ordinals must be positive integers");return e}catch(e){if(e instanceof RangeError)throw e;throw new RangeError(`Invalid ordinal format: "${t}"`,{cause:e})}}(t);throw new TypeError(`Invalid value type: expected number, string, or bigint, received ${i}`)}(t);return s(i,R),M(i)}function z(e){const{isNegative:n,dollars:i,cents:o}=function(e){const n=typeof e;if("bigint"==typeof e)return e<0n?{isNegative:!0,dollars:-e,cents:0n}:{isNegative:!1,dollars:e,cents:0n};if("number"==typeof e){if(!Number.isFinite(e))throw new RangeError("Currency must be a finite number");return Number.isSafeInteger(e)?e<0?{isNegative:!0,dollars:BigInt(-e),cents:0n}:{isNegative:!1,dollars:BigInt(e),cents:0n}:r(t(e))}if("string"==typeof e)return r(e);throw new TypeError(`Invalid value type: expected number, string, or bigint, received ${n}`)}(e);s(i,$);let a="";return n&&(a=g+" "),(i>0n||0n===o)&&(a+=O(i,"masculine"),a+=" "+y(i,w)),o>0n&&(i>0n&&(a+=" "),a+=O(o,"masculine"),a+=" "+y(o,j)),a}export{P as cardinalDefaults,B as cardinalMax,x as cardinalValues,$ as currencyMax,R as ordinalMax,k as toCardinal,z as toCurrency,T as toOrdinal};
package/dist/hr-HR.umd.js CHANGED
@@ -1,2 +1,2 @@
1
- /*! n2words/hr-HR v5.1.0 | MIT License | github.com/forzagreen/n2words */
1
+ /*! n2words/hr-HR v5.1.1 | MIT License | github.com/forzagreen/n2words */
2
2
  var e,t;e=this,t=function(e){"use strict";function t(e){let[t,n]=e.toLowerCase().split("e");const i=parseInt(n,10);let r="";"-"===t[0]&&(r="-",t=t.slice(1));const s=t.indexOf("."),o=-1===s?t:t.slice(0,s)+t.slice(s+1),a=(-1===s?t.length:s)+i;return a>=o.length?r+o+"0".repeat(a-o.length):a<=0?r+"0."+"0".repeat(-a)+o:r+o.slice(0,a)+"."+o.slice(a)}function n(e){const n=e.toString();return i(n)?t(n):n}function i(e){return e.includes("e")||e.includes("E")}function r(e){const t="-"===e[0];t&&(e=e.slice(1));const n=e.indexOf(".");if(-1===n)return{isNegative:t,integerPart:BigInt(e)};const i=e.slice(0,n)||"0",r=e.slice(n+1);return{isNegative:t,integerPart:BigInt(i),decimalPart:r}}function s(e){let n=e.trim();if(0===n.length||Number.isNaN(Number(n)))throw new RangeError(`Invalid currency format: "${e}"`);i(n)&&(n=t(n));const r="-"===n[0];r&&(n=n.slice(1));const s=n.indexOf(".");if(-1===s)return{isNegative:r,dollars:BigInt(n),cents:0n};const o=n.slice(0,s)||"0",a=(n.slice(s+1)+"00").slice(0,2);return{isNegative:r,dollars:BigInt(o),cents:BigInt(a)}}function o(e,t,n){if(null===t)return;if(e<t&&!(n&&BigInt(n)>=t))return;const i=t.toString().length-1,r=t===10n**BigInt(i)?`10^${i} - 1`:""+(t-1n);throw new RangeError(`Number too large to convert: the largest supported value is ${r}`)}function a(e){return 10n**BigInt(3*(e+1))}const u=["","jedan","dva","tri","četiri","pet","šest","sedam","osam","devet"],c=["","jedna","dvije","tri","četiri","pet","šest","sedam","osam","devet"],l=["deset","jedanaest","dvanaest","trinaest","četrnaest","petnaest","šesnaest","sedamnaest","osamnaest","devetnaest"],f=["","","dvadeset","trideset","četrdeset","pedeset","šezdeset","sedamdeset","osamdeset","devedeset"],d=["","sto","dvjesto","tristo","četiristo","petsto","šesto","sedamsto","osamsto","devetsto"],g="nula",m="minus",p=["","prvi","drugi","treći","četvrti","peti","šesti","sedmi","osmi","deveti"],h=["deseti","jedanaesti","dvanaesti","trinaesti","četrnaesti","petnaesti","šesnaesti","sedamnaesti","osamnaesti","devetnaesti"],b=["","","dvadeseti","trideseti","četrdeseti","pedeseti","šezdeseti","sedamdeseti","osamdeseti","devedeseti"],v=["","stoti","dvjestoti","tristoti","četiristoti","petstoti","šeststoti","sedamstoti","osamstoti","devetstoti"],w=["tisućiti","milijunti","milijarditi","bilijunti"],j=["euro","eura","eura"],N=["cent","centa","centi"],y=[["tisuća","tisuće","tisuća"],["milijun","milijuna","milijuna"],["milijarda","milijarde","milijarda"],["bilijun","bilijuna","bilijuna"],["bilijarda","bilijarde","bilijarda"],["trilijun","trilijuna","trilijuna"],["trilijarda","trilijarde","trilijarda"],["kvadrilijun","kvadrilijuna","kvadrilijuna"],["kvadrilijarda","kvadrilijarde","kvadrilijarda"]];function I(e,t){const n="bigint"==typeof e?Number(e):e,i=n%10,r=n%100;return r>=11&&r<=19?t[2]:1===i?t[0]:i>=2&&i<=4?t[1]:t[2]}function E(e){if(0===e)return"";const t=e%10,n=Math.trunc(e/10)%10,i=Math.trunc(e/100),r=[];return i>0&&r.push(d[i]),n>1&&r.push(f[n]),1===n?r.push(l[t]):t>0&&r.push(u[t]),r.join(" ")}function O(e){if(0===e)return"";const t=e%10,n=Math.trunc(e/10)%10,i=Math.trunc(e/100),r=[];return i>0&&r.push(d[i]),n>1&&r.push(f[n]),1===n?r.push(l[t]):t>0&&r.push(c[t]),r.join(" ")}function R(e,t){return 0n===e?g:e<1000n?"feminine"===t?O(Number(e)):E(Number(e)):function(e,t){const n=e.toString(),i=n.length,r=[],s=i%3;let o=0;for(s>0&&(r.push(Number(n.slice(0,s))),o=s);o<i;)r.push(Number(n.slice(o,o+3))),o+=3;const a=[];let u=r.length-1;for(let e=0;e<r.length;e++){const n=r[e];if(0!==n)if(0===u)a.push("feminine"===t?O(n):E(n));else{const e=I(n,y[u-1]),t=1===u?O(n):E(n);a.push(t+" "+e)}u--}return a.join(" ")}(e,t)}const B=a(y.length),$=a(w.length),x=a(y.length),P={gender:"masculine"},k={gender:["masculine","feminine"]};function T(e){if(0===e)return"";const t=e%10,n=Math.trunc(e/10);return 0===n?p[t]:1===n?h[t]:0===t?b[n]:f[n]+" "+p[t]}function S(e){if(e<100n)return T(Number(e));if(e<1000n){const t=Number(e),n=Math.trunc(t/100),i=t%100;return 0===i?v[n]:d[n]+" "+T(i)}if(e<1000000n){const t=Number(e/1000n),n=Number(e%1000n);if(0===n)return 1===t?w[0]:O(t)+" "+w[0];const i=I(t,y[0]);return O(t)+" "+i+" "+S(BigInt(n))}return function(e){const t=e.toString(),n=t.length,i=[],r=n%3;let s=0;for(r>0&&(i.push(Number(t.slice(0,r))),s=r);s<n;)i.push(Number(t.slice(s,s+3))),s+=3;let o=i.length-1;for(;o>=0&&0===i[o];)o--;const a=[];let u=i.length-1;for(let e=0;e<i.length;e++){const t=i[e];if(0!==t){const n=e===o;if(0===u)a.push(n?S(BigInt(t)):E(t));else if(n)if(1===t)a.push(w[u-1]);else{const e=1===u?O(t):E(t);a.push(e+" "+w[u-1])}else{const e=I(t,y[u-1]),n=1===u?O(t):E(t);a.push(n+" "+e)}}u--}return a.join(" ")}(e)}const M={hrHR:function(e){const n=function(e){const n=typeof e;if("bigint"==typeof e){if(e<=0n)throw new RangeError("Ordinals must be positive integers");return e}if("number"==typeof e){if(!Number.isFinite(e))throw new RangeError("Ordinals must be finite numbers");if(!Number.isInteger(e))throw new RangeError("Ordinals must be whole numbers");if(e<=0)throw new RangeError("Ordinals must be positive integers");return BigInt(e)}if("string"==typeof e)return function(e){const n=e.trim();if(0===n.length)throw new RangeError("Ordinals cannot be empty strings");if("-"===n[0])throw new RangeError("Ordinals cannot be negative");if(n.includes("."))throw new RangeError("Ordinals must be whole numbers");if(i(n)){const e=t(n);if(e.includes("."))throw new RangeError("Ordinals must be whole numbers");const i=BigInt(e);if(i<=0n)throw new RangeError("Ordinals must be positive integers");return i}try{const e=BigInt(n);if(e<=0n)throw new RangeError("Ordinals must be positive integers");return e}catch(t){if(t instanceof RangeError)throw t;throw new RangeError(`Invalid ordinal format: "${e}"`,{cause:t})}}(e);throw new TypeError(`Invalid value type: expected number, string, or bigint, received ${n}`)}(e);return o(n,$),S(n)}};e.currency={hrHR:function(e){const{isNegative:t,dollars:i,cents:r}=function(e){const t=typeof e;if("bigint"==typeof e)return e<0n?{isNegative:!0,dollars:-e,cents:0n}:{isNegative:!1,dollars:e,cents:0n};if("number"==typeof e){if(!Number.isFinite(e))throw new RangeError("Currency must be a finite number");return Number.isSafeInteger(e)?e<0?{isNegative:!0,dollars:BigInt(-e),cents:0n}:{isNegative:!1,dollars:BigInt(e),cents:0n}:s(n(e))}if("string"==typeof e)return s(e);throw new TypeError(`Invalid value type: expected number, string, or bigint, received ${t}`)}(e);o(i,x);let a="";return t&&(a=m+" "),(i>0n||0n===r)&&(a+=R(i,"masculine"),a+=" "+I(i,j)),r>0n&&(i>0n&&(a+=" "),a+=R(r,"masculine"),a+=" "+I(r,N)),a}},e.hrHR=function(e,s){const{isNegative:a,integerPart:u,decimalPart:c}=function(e){const s=typeof e;if("bigint"==typeof e)return e<0n?{isNegative:!0,integerPart:-e}:{isNegative:!1,integerPart:e};if("number"==typeof e){if(!Number.isFinite(e))throw new RangeError("Number must be finite (NaN and Infinity are not supported)");return Number.isSafeInteger(e)?e<0?{isNegative:!0,integerPart:BigInt(-e)}:{isNegative:!1,integerPart:BigInt(e)}:r(n(e))}if("string"==typeof e)return r(function(e){const n=e.trim();if(0===n.length||Number.isNaN(Number(n)))throw new RangeError(`Invalid number format: "${e}"`);return i(n)?t(n):n}(e));throw new TypeError(`Invalid value type: expected number, string, or bigint, received ${s}`)}(e);o(u,B,c);const{gender:l}=function(e,t,n){const i={...t};if(void 0===e)return i;if(!function(e){if(null===e||"object"!=typeof e)return!1;const t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}(e))throw new TypeError("Invalid options: expected plain object or undefined, got "+typeof e);const r=Object.keys(t);for(const[s,o]of Object.entries(e)){if(!Object.hasOwn(t,s))throw new TypeError(`Unknown option "${s}" — expected one of: ${r.join(", ")}`);if(void 0!==o){if(typeof o!=typeof i[s])throw new TypeError(`Option "${s}" must be a ${typeof i[s]}, got ${typeof o}`);if(void 0!==n&&Object.hasOwn(n,s)){const e=n[s];if(!e.includes(o))throw new RangeError(`Option "${s}" must be one of: ${e.join(", ")} — got ${JSON.stringify(o)}`)}i[s]=o}}return i}(s,P,k);let f="";return a&&(f=m+" "),f+=R(u,l),c&&(f+=" zarez "+function(e,t){let n="",i=0;for(;i<e.length&&"0"===e[i];)n&&(n+=" "),n+=g,i++;const r=e.slice(i);return r&&(n&&(n+=" "),n+=R(BigInt(r),t)),n}(c,l)),f},e.ordinal=M},"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).n2words=e.n2words||{});
package/dist/hu-HU.js CHANGED
@@ -1,2 +1,2 @@
1
- /*! n2words/hu-HU v5.1.0 | MIT License | github.com/forzagreen/n2words */
1
+ /*! n2words/hu-HU v5.1.1 | MIT License | github.com/forzagreen/n2words */
2
2
  function n(n){let[e,t]=n.toLowerCase().split("e");const i=parseInt(t,10);let r="";"-"===e[0]&&(r="-",e=e.slice(1));const o=e.indexOf("."),s=-1===o?e:e.slice(0,o)+e.slice(o+1),u=(-1===o?e.length:o)+i;return u>=s.length?r+s+"0".repeat(u-s.length):u<=0?r+"0."+"0".repeat(-u)+s:r+s.slice(0,u)+"."+s.slice(u)}function e(e){const i=e.toString();return t(i)?n(i):i}function t(n){return n.includes("e")||n.includes("E")}function i(n){const e="-"===n[0];e&&(n=n.slice(1));const t=n.indexOf(".");if(-1===t)return{isNegative:e,integerPart:BigInt(n)};const i=n.slice(0,t)||"0",r=n.slice(t+1);return{isNegative:e,integerPart:BigInt(i),decimalPart:r}}function r(e){let i=e.trim();if(0===i.length||Number.isNaN(Number(i)))throw new RangeError(`Invalid currency format: "${e}"`);t(i)&&(i=n(i));const r="-"===i[0];r&&(i=i.slice(1));const o=i.indexOf(".");if(-1===o)return{isNegative:r,dollars:BigInt(i),cents:0n};const s=i.slice(0,o)||"0",u=(i.slice(o+1)+"00").slice(0,2);return{isNegative:r,dollars:BigInt(s),cents:BigInt(u)}}const o=null,s=o,u=o,a=o,l=new Map([[1000000000000000000000000000n,"quadrilliárd"],[1000000000000000000000000n,"quadrillió"],[1000000000000000000000n,"trilliárd"],[1000000000000000000n,"trillió"],[1000000000000000n,"billiárd"],[1000000000000n,"billió"],[1000000000n,"milliárd"],[1000000n,"millió"],[1000n,"ezer"],[100n,"száz"],[90n,"kilencven"],[80n,"nyolcvan"],[70n,"hetven"],[60n,"hatvan"],[50n,"ötven"],[40n,"negyven"],[30n,"harminc"],[29n,"huszonkilenc"],[28n,"huszonnyolc"],[27n,"huszonhét"],[26n,"huszonhat"],[25n,"huszonöt"],[24n,"huszonnégy"],[23n,"huszonhárom"],[22n,"huszonkettő"],[21n,"huszonegy"],[20n,"húsz"],[19n,"tizenkilenc"],[18n,"tizennyolc"],[17n,"tizenhét"],[16n,"tizenhat"],[15n,"tizenöt"],[14n,"tizennégy"],[13n,"tizenhárom"],[12n,"tizenkettő"],[11n,"tizenegy"],[10n,"tíz"],[9n,"kilenc"],[8n,"nyolc"],[7n,"hét"],[6n,"hat"],[5n,"öt"],[4n,"négy"],[3n,"három"],[2n,"kettő"],[1n,"egy"],[0n,"nulla"]]),c="nulla",g="mínusz",f={1:"első",2:"második",3:"harmadik",4:"negyedik",5:"ötödik",6:"hatodik",7:"hetedik",8:"nyolcadik",9:"kilencedik",10:"tizedik",20:"huszadik",30:"harmincadik",40:"negyvenedik",50:"ötvenedik",60:"hatvanadik",70:"hetvenedik",80:"nyolcvanadik",90:"kilencvenedik",100:"századik",1e3:"ezredik"};function d(n){return l.get(n)}const h=[1000000000000000000000000000n,1000000000000000000000000n,1000000000000000000000n,1000000000000000000n,1000000000000000n,1000000000000n,1000000000n,1000000n];function m(n,e=c){return"bigint"!=typeof n&&(n=BigInt(n)),0n===n?e:""===e&&2n===n?"két":n<30n?d(n):n<100n?function(n){if(l.has(n))return l.get(n);const e=n%10n;return d(n/10n*10n)+m(e)}(n):n<1000n?function(n){const e=n/100n;let t="száz";return 1n!==e&&(t=m(e,"")+t),t+m(n%100n,"")}(n):n<1000000n?function(n){const e=n/1000n;let t="ezer";1n!==e&&(t=m(e,"")+t);const i=m(n%1000n,"");return t+(n<=2000n||""===i?"":"-")+i}(n):function(n){let e=1000000n;for(const t of h)if(n>=t){e=t;break}const t=m(n/e,""),i=m(n%e,""),r=""===i?"":"-"+i;return t+d(e)+r}(n)}function b(n){return m(n,c)}function v(r){const{isNegative:o,integerPart:s,decimalPart:u}=function(r){const o=typeof r;if("bigint"==typeof r)return r<0n?{isNegative:!0,integerPart:-r}:{isNegative:!1,integerPart:r};if("number"==typeof r){if(!Number.isFinite(r))throw new RangeError("Number must be finite (NaN and Infinity are not supported)");return Number.isSafeInteger(r)?r<0?{isNegative:!0,integerPart:BigInt(-r)}:{isNegative:!1,integerPart:BigInt(r)}:i(e(r))}if("string"==typeof r)return i(function(e){const i=e.trim();if(0===i.length||Number.isNaN(Number(i)))throw new RangeError(`Invalid number format: "${e}"`);return t(i)?n(i):i}(r));throw new TypeError(`Invalid value type: expected number, string, or bigint, received ${o}`)}(r);let a="";return o&&(a=g+" "),a+=b(s),u&&(a+=" egész "+function(n){let e="",t=0;for(;t<n.length&&"0"===n[t];)e&&(e+=" "),e+=c,t++;const i=n.slice(t);return i&&(e&&(e+=" "),e+=b(BigInt(i))),e}(u)),a}function w(e){return function(n){const e=Number(n);if(f[e])return f[e];const t=b(n);if("aáoóuúeéiíöőüű".includes(t[t.length-1]))return t+"dik";for(let n=t.length-1;n>=0;n--){const e=t[n];if("aáoóuú".includes(e))return t+"adik";if("öőüű".includes(e))return t+"ödik";if("eéií".includes(e))return t+"edik"}return t+"edik"}(function(e){const i=typeof e;if("bigint"==typeof e){if(e<=0n)throw new RangeError("Ordinals must be positive integers");return e}if("number"==typeof e){if(!Number.isFinite(e))throw new RangeError("Ordinals must be finite numbers");if(!Number.isInteger(e))throw new RangeError("Ordinals must be whole numbers");if(e<=0)throw new RangeError("Ordinals must be positive integers");return BigInt(e)}if("string"==typeof e)return function(e){const i=e.trim();if(0===i.length)throw new RangeError("Ordinals cannot be empty strings");if("-"===i[0])throw new RangeError("Ordinals cannot be negative");if(i.includes("."))throw new RangeError("Ordinals must be whole numbers");if(t(i)){const e=n(i);if(e.includes("."))throw new RangeError("Ordinals must be whole numbers");const t=BigInt(e);if(t<=0n)throw new RangeError("Ordinals must be positive integers");return t}try{const n=BigInt(i);if(n<=0n)throw new RangeError("Ordinals must be positive integers");return n}catch(n){if(n instanceof RangeError)throw n;throw new RangeError(`Invalid ordinal format: "${e}"`,{cause:n})}}(e);throw new TypeError(`Invalid value type: expected number, string, or bigint, received ${i}`)}(e))}function y(n){const{isNegative:t,dollars:i,cents:o}=function(n){const t=typeof n;if("bigint"==typeof n)return n<0n?{isNegative:!0,dollars:-n,cents:0n}:{isNegative:!1,dollars:n,cents:0n};if("number"==typeof n){if(!Number.isFinite(n))throw new RangeError("Currency must be a finite number");return Number.isSafeInteger(n)?n<0?{isNegative:!0,dollars:BigInt(-n),cents:0n}:{isNegative:!1,dollars:BigInt(n),cents:0n}:r(e(n))}if("string"==typeof n)return r(n);throw new TypeError(`Invalid value type: expected number, string, or bigint, received ${t}`)}(n);let s="";return t&&(s=g+" "),(i>0n||0n===o)&&(s+=b(i)+" forint"),o>0n&&(i>0n&&(s+=" "),s+=b(o)+" fillér"),s}export{s as cardinalMax,a as currencyMax,u as ordinalMax,v as toCardinal,y as toCurrency,w as toOrdinal};
package/dist/hu-HU.umd.js CHANGED
@@ -1,2 +1,2 @@
1
- /*! n2words/hu-HU v5.1.0 | MIT License | github.com/forzagreen/n2words */
1
+ /*! n2words/hu-HU v5.1.1 | MIT License | github.com/forzagreen/n2words */
2
2
  var n,e;n=this,e=function(n){"use strict";function e(n){let[e,t]=n.toLowerCase().split("e");const i=parseInt(t,10);let r="";"-"===e[0]&&(r="-",e=e.slice(1));const o=e.indexOf("."),s=-1===o?e:e.slice(0,o)+e.slice(o+1),u=(-1===o?e.length:o)+i;return u>=s.length?r+s+"0".repeat(u-s.length):u<=0?r+"0."+"0".repeat(-u)+s:r+s.slice(0,u)+"."+s.slice(u)}function t(n){const t=n.toString();return i(t)?e(t):t}function i(n){return n.includes("e")||n.includes("E")}function r(n){const e="-"===n[0];e&&(n=n.slice(1));const t=n.indexOf(".");if(-1===t)return{isNegative:e,integerPart:BigInt(n)};const i=n.slice(0,t)||"0",r=n.slice(t+1);return{isNegative:e,integerPart:BigInt(i),decimalPart:r}}function o(n){let t=n.trim();if(0===t.length||Number.isNaN(Number(t)))throw new RangeError(`Invalid currency format: "${n}"`);i(t)&&(t=e(t));const r="-"===t[0];r&&(t=t.slice(1));const o=t.indexOf(".");if(-1===o)return{isNegative:r,dollars:BigInt(t),cents:0n};const s=t.slice(0,o)||"0",u=(t.slice(o+1)+"00").slice(0,2);return{isNegative:r,dollars:BigInt(s),cents:BigInt(u)}}const s=new Map([[1000000000000000000000000000n,"quadrilliárd"],[1000000000000000000000000n,"quadrillió"],[1000000000000000000000n,"trilliárd"],[1000000000000000000n,"trillió"],[1000000000000000n,"billiárd"],[1000000000000n,"billió"],[1000000000n,"milliárd"],[1000000n,"millió"],[1000n,"ezer"],[100n,"száz"],[90n,"kilencven"],[80n,"nyolcvan"],[70n,"hetven"],[60n,"hatvan"],[50n,"ötven"],[40n,"negyven"],[30n,"harminc"],[29n,"huszonkilenc"],[28n,"huszonnyolc"],[27n,"huszonhét"],[26n,"huszonhat"],[25n,"huszonöt"],[24n,"huszonnégy"],[23n,"huszonhárom"],[22n,"huszonkettő"],[21n,"huszonegy"],[20n,"húsz"],[19n,"tizenkilenc"],[18n,"tizennyolc"],[17n,"tizenhét"],[16n,"tizenhat"],[15n,"tizenöt"],[14n,"tizennégy"],[13n,"tizenhárom"],[12n,"tizenkettő"],[11n,"tizenegy"],[10n,"tíz"],[9n,"kilenc"],[8n,"nyolc"],[7n,"hét"],[6n,"hat"],[5n,"öt"],[4n,"négy"],[3n,"három"],[2n,"kettő"],[1n,"egy"],[0n,"nulla"]]),u="nulla",a="mínusz",l={1:"első",2:"második",3:"harmadik",4:"negyedik",5:"ötödik",6:"hatodik",7:"hetedik",8:"nyolcadik",9:"kilencedik",10:"tizedik",20:"huszadik",30:"harmincadik",40:"negyvenedik",50:"ötvenedik",60:"hatvanadik",70:"hetvenedik",80:"nyolcvanadik",90:"kilencvenedik",100:"századik",1e3:"ezredik"};function c(n){return s.get(n)}const f=[1000000000000000000000000000n,1000000000000000000000000n,1000000000000000000000n,1000000000000000000n,1000000000000000n,1000000000000n,1000000000n,1000000n];function g(n,e=u){return"bigint"!=typeof n&&(n=BigInt(n)),0n===n?e:""===e&&2n===n?"két":n<30n?c(n):n<100n?function(n){if(s.has(n))return s.get(n);const e=n%10n;return c(n/10n*10n)+g(e)}(n):n<1000n?function(n){const e=n/100n;let t="száz";return 1n!==e&&(t=g(e,"")+t),t+g(n%100n,"")}(n):n<1000000n?function(n){const e=n/1000n;let t="ezer";1n!==e&&(t=g(e,"")+t);const i=g(n%1000n,"");return t+(n<=2000n||""===i?"":"-")+i}(n):function(n){let e=1000000n;for(const t of f)if(n>=t){e=t;break}const t=g(n/e,""),i=g(n%e,""),r=""===i?"":"-"+i;return t+c(e)+r}(n)}function d(n){return g(n,u)}const h={huHU:function(n){return function(n){const e=Number(n);if(l[e])return l[e];const t=d(n);if("aáoóuúeéiíöőüű".includes(t[t.length-1]))return t+"dik";for(let n=t.length-1;n>=0;n--){const e=t[n];if("aáoóuú".includes(e))return t+"adik";if("öőüű".includes(e))return t+"ödik";if("eéií".includes(e))return t+"edik"}return t+"edik"}(function(n){const t=typeof n;if("bigint"==typeof n){if(n<=0n)throw new RangeError("Ordinals must be positive integers");return n}if("number"==typeof n){if(!Number.isFinite(n))throw new RangeError("Ordinals must be finite numbers");if(!Number.isInteger(n))throw new RangeError("Ordinals must be whole numbers");if(n<=0)throw new RangeError("Ordinals must be positive integers");return BigInt(n)}if("string"==typeof n)return function(n){const t=n.trim();if(0===t.length)throw new RangeError("Ordinals cannot be empty strings");if("-"===t[0])throw new RangeError("Ordinals cannot be negative");if(t.includes("."))throw new RangeError("Ordinals must be whole numbers");if(i(t)){const n=e(t);if(n.includes("."))throw new RangeError("Ordinals must be whole numbers");const i=BigInt(n);if(i<=0n)throw new RangeError("Ordinals must be positive integers");return i}try{const n=BigInt(t);if(n<=0n)throw new RangeError("Ordinals must be positive integers");return n}catch(e){if(e instanceof RangeError)throw e;throw new RangeError(`Invalid ordinal format: "${n}"`,{cause:e})}}(n);throw new TypeError(`Invalid value type: expected number, string, or bigint, received ${t}`)}(n))}};n.currency={huHU:function(n){const{isNegative:e,dollars:i,cents:r}=function(n){const e=typeof n;if("bigint"==typeof n)return n<0n?{isNegative:!0,dollars:-n,cents:0n}:{isNegative:!1,dollars:n,cents:0n};if("number"==typeof n){if(!Number.isFinite(n))throw new RangeError("Currency must be a finite number");return Number.isSafeInteger(n)?n<0?{isNegative:!0,dollars:BigInt(-n),cents:0n}:{isNegative:!1,dollars:BigInt(n),cents:0n}:o(t(n))}if("string"==typeof n)return o(n);throw new TypeError(`Invalid value type: expected number, string, or bigint, received ${e}`)}(n);let s="";return e&&(s=a+" "),(i>0n||0n===r)&&(s+=d(i)+" forint"),r>0n&&(i>0n&&(s+=" "),s+=d(r)+" fillér"),s}},n.huHU=function(n){const{isNegative:o,integerPart:s,decimalPart:l}=function(n){const o=typeof n;if("bigint"==typeof n)return n<0n?{isNegative:!0,integerPart:-n}:{isNegative:!1,integerPart:n};if("number"==typeof n){if(!Number.isFinite(n))throw new RangeError("Number must be finite (NaN and Infinity are not supported)");return Number.isSafeInteger(n)?n<0?{isNegative:!0,integerPart:BigInt(-n)}:{isNegative:!1,integerPart:BigInt(n)}:r(t(n))}if("string"==typeof n)return r(function(n){const t=n.trim();if(0===t.length||Number.isNaN(Number(t)))throw new RangeError(`Invalid number format: "${n}"`);return i(t)?e(t):t}(n));throw new TypeError(`Invalid value type: expected number, string, or bigint, received ${o}`)}(n);let c="";return o&&(c=a+" "),c+=d(s),l&&(c+=" egész "+function(n){let e="",t=0;for(;t<n.length&&"0"===n[t];)e&&(e+=" "),e+=u,t++;const i=n.slice(t);return i&&(e&&(e+=" "),e+=d(BigInt(i))),e}(l)),c},n.ordinal=h},"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((n="undefined"!=typeof globalThis?globalThis:n||self).n2words=n.n2words||{});
package/dist/id-ID.js CHANGED
@@ -1,2 +1,2 @@
1
- /*! n2words/id-ID v5.1.0 | MIT License | github.com/forzagreen/n2words */
1
+ /*! n2words/id-ID v5.1.1 | MIT License | github.com/forzagreen/n2words */
2
2
  function e(e){let[n,t]=e.toLowerCase().split("e");const r=parseInt(t,10);let i="";"-"===n[0]&&(i="-",n=n.slice(1));const s=n.indexOf("."),u=-1===s?n:n.slice(0,s)+n.slice(s+1),o=(-1===s?n.length:s)+r;return o>=u.length?i+u+"0".repeat(o-u.length):o<=0?i+"0."+"0".repeat(-o)+u:i+u.slice(0,o)+"."+u.slice(o)}function n(n){const r=n.toString();return t(r)?e(r):r}function t(e){return e.includes("e")||e.includes("E")}function r(e){const n="-"===e[0];n&&(e=e.slice(1));const t=e.indexOf(".");if(-1===t)return{isNegative:n,integerPart:BigInt(e)};const r=e.slice(0,t)||"0",i=e.slice(t+1);return{isNegative:n,integerPart:BigInt(r),decimalPart:i}}function i(n){let r=n.trim();if(0===r.length||Number.isNaN(Number(r)))throw new RangeError(`Invalid currency format: "${n}"`);t(r)&&(r=e(r));const i="-"===r[0];i&&(r=r.slice(1));const s=r.indexOf(".");if(-1===s)return{isNegative:i,dollars:BigInt(r),cents:0n};const u=r.slice(0,s)||"0",o=(r.slice(s+1)+"00").slice(0,2);return{isNegative:i,dollars:BigInt(u),cents:BigInt(o)}}function s(e,n,t){if(null===n)return;if(e<n&&!(t&&BigInt(t)>=n))return;const r=n.toString().length-1,i=n===10n**BigInt(r)?`10^${r} - 1`:""+(n-1n);throw new RangeError(`Number too large to convert: the largest supported value is ${i}`)}function u(e){return 10n**BigInt(3*(e+1))}const o=["","satu","dua","tiga","empat","lima","enam","tujuh","delapan","sembilan"],a=["sepuluh","sebelas","dua belas","tiga belas","empat belas","lima belas","enam belas","tujuh belas","delapan belas","sembilan belas"],l=["","","dua puluh","tiga puluh","empat puluh","lima puluh","enam puluh","tujuh puluh","delapan puluh","sembilan puluh"],g="ratus",c="ribu",f=["juta","miliar","triliun","kuadriliun","kuantiliun","sekstiliun","septiliun","oktiliun","noniliun","desiliun"],m=u(f.length+1),h=u(f.length+1),b=u(f.length+1);function p(e){if(0===e)return"";const n=e%10,t=Math.trunc(e/10)%10,r=Math.trunc(e/100),i=[];r>0&&i.push(1===r?"se"+g:o[r]+" "+g);const s=e%100;return 0===s||i.push(s<10?o[s]:s<20?a[s-10]:0===n?l[t]:l[t]+" "+o[n]),i.join(" ")}function d(e){if(0n===e)return"nol";if(e<1000n)return p(Number(e));if(e<1000000n){const n=Number(e/1000n),t=Number(e%1000n);let r;return r=1===n?"se"+c:p(n)+" "+c,t>0&&(r+=" "+p(t)),r}return function(e){const n=e.toString(),t=n.length,r=[],i=t%3;let s=0;for(i>0&&(r.push(Number(n.slice(0,i))),s=i);s<t;)r.push(Number(n.slice(s,s+3))),s+=3;const u=[];let o=r.length-1;for(let e=0;e<r.length;e++){const n=r[e];if(0!==n)if(0===o)u.push(p(n));else if(1===o)u.push(1===n?"se"+c:p(n)+" "+c);else{const e=f[o-2];u.push(p(n)+" "+e)}o--}return u.join(" ")}(e)}function w(i){const{isNegative:u,integerPart:o,decimalPart:a}=function(i){const s=typeof i;if("bigint"==typeof i)return i<0n?{isNegative:!0,integerPart:-i}:{isNegative:!1,integerPart:i};if("number"==typeof i){if(!Number.isFinite(i))throw new RangeError("Number must be finite (NaN and Infinity are not supported)");return Number.isSafeInteger(i)?i<0?{isNegative:!0,integerPart:BigInt(-i)}:{isNegative:!1,integerPart:BigInt(i)}:r(n(i))}if("string"==typeof i)return r(function(n){const r=n.trim();if(0===r.length||Number.isNaN(Number(r)))throw new RangeError(`Invalid number format: "${n}"`);return t(r)?e(r):r}(i));throw new TypeError(`Invalid value type: expected number, string, or bigint, received ${s}`)}(i);s(o,m,a);let l="";return u&&(l="min "),l+=d(o),a&&(l+=" koma "+function(e){let n="",t=0;for(;t<e.length&&"0"===e[t];)n&&(n+=" "),n+="nol",t++;const r=e.slice(t);return r&&(n&&(n+=" "),n+=d(BigInt(r))),n}(a)),l}function N(n){const r=function(n){const r=typeof n;if("bigint"==typeof n){if(n<=0n)throw new RangeError("Ordinals must be positive integers");return n}if("number"==typeof n){if(!Number.isFinite(n))throw new RangeError("Ordinals must be finite numbers");if(!Number.isInteger(n))throw new RangeError("Ordinals must be whole numbers");if(n<=0)throw new RangeError("Ordinals must be positive integers");return BigInt(n)}if("string"==typeof n)return function(n){const r=n.trim();if(0===r.length)throw new RangeError("Ordinals cannot be empty strings");if("-"===r[0])throw new RangeError("Ordinals cannot be negative");if(r.includes("."))throw new RangeError("Ordinals must be whole numbers");if(t(r)){const n=e(r);if(n.includes("."))throw new RangeError("Ordinals must be whole numbers");const t=BigInt(n);if(t<=0n)throw new RangeError("Ordinals must be positive integers");return t}try{const e=BigInt(r);if(e<=0n)throw new RangeError("Ordinals must be positive integers");return e}catch(e){if(e instanceof RangeError)throw e;throw new RangeError(`Invalid ordinal format: "${n}"`,{cause:e})}}(n);throw new TypeError(`Invalid value type: expected number, string, or bigint, received ${r}`)}(n);return s(r,h),1n===(i=r)?"pertama":"ke"+d(i);var i}function v(e){const{isNegative:t,dollars:r}=function(e){const t=typeof e;if("bigint"==typeof e)return e<0n?{isNegative:!0,dollars:-e,cents:0n}:{isNegative:!1,dollars:e,cents:0n};if("number"==typeof e){if(!Number.isFinite(e))throw new RangeError("Currency must be a finite number");return Number.isSafeInteger(e)?e<0?{isNegative:!0,dollars:BigInt(-e),cents:0n}:{isNegative:!1,dollars:BigInt(e),cents:0n}:i(n(e))}if("string"==typeof e)return i(e);throw new TypeError(`Invalid value type: expected number, string, or bigint, received ${t}`)}(e);s(r,b);let u="";return t&&(u="min "),u+=d(r),u+=" rupiah",u}export{m as cardinalMax,b as currencyMax,h as ordinalMax,w as toCardinal,v as toCurrency,N as toOrdinal};
package/dist/id-ID.umd.js CHANGED
@@ -1,2 +1,2 @@
1
- /*! n2words/id-ID v5.1.0 | MIT License | github.com/forzagreen/n2words */
1
+ /*! n2words/id-ID v5.1.1 | MIT License | github.com/forzagreen/n2words */
2
2
  var e,n;e=this,n=function(e){"use strict";function n(e){let[n,t]=e.toLowerCase().split("e");const r=parseInt(t,10);let i="";"-"===n[0]&&(i="-",n=n.slice(1));const s=n.indexOf("."),o=-1===s?n:n.slice(0,s)+n.slice(s+1),u=(-1===s?n.length:s)+r;return u>=o.length?i+o+"0".repeat(u-o.length):u<=0?i+"0."+"0".repeat(-u)+o:i+o.slice(0,u)+"."+o.slice(u)}function t(e){const t=e.toString();return r(t)?n(t):t}function r(e){return e.includes("e")||e.includes("E")}function i(e){const n="-"===e[0];n&&(e=e.slice(1));const t=e.indexOf(".");if(-1===t)return{isNegative:n,integerPart:BigInt(e)};const r=e.slice(0,t)||"0",i=e.slice(t+1);return{isNegative:n,integerPart:BigInt(r),decimalPart:i}}function s(e){let t=e.trim();if(0===t.length||Number.isNaN(Number(t)))throw new RangeError(`Invalid currency format: "${e}"`);r(t)&&(t=n(t));const i="-"===t[0];i&&(t=t.slice(1));const s=t.indexOf(".");if(-1===s)return{isNegative:i,dollars:BigInt(t),cents:0n};const o=t.slice(0,s)||"0",u=(t.slice(s+1)+"00").slice(0,2);return{isNegative:i,dollars:BigInt(o),cents:BigInt(u)}}function o(e,n,t){if(null===n)return;if(e<n&&!(t&&BigInt(t)>=n))return;const r=n.toString().length-1,i=n===10n**BigInt(r)?`10^${r} - 1`:""+(n-1n);throw new RangeError(`Number too large to convert: the largest supported value is ${i}`)}function u(e){return 10n**BigInt(3*(e+1))}const a=["","satu","dua","tiga","empat","lima","enam","tujuh","delapan","sembilan"],l=["sepuluh","sebelas","dua belas","tiga belas","empat belas","lima belas","enam belas","tujuh belas","delapan belas","sembilan belas"],c=["","","dua puluh","tiga puluh","empat puluh","lima puluh","enam puluh","tujuh puluh","delapan puluh","sembilan puluh"],g="ratus",f="ribu",m=["juta","miliar","triliun","kuadriliun","kuantiliun","sekstiliun","septiliun","oktiliun","noniliun","desiliun"],p=u(m.length+1),d=u(m.length+1),h=u(m.length+1);function b(e){if(0===e)return"";const n=e%10,t=Math.trunc(e/10)%10,r=Math.trunc(e/100),i=[];r>0&&i.push(1===r?"se"+g:a[r]+" "+g);const s=e%100;return 0===s||i.push(s<10?a[s]:s<20?l[s-10]:0===n?c[t]:c[t]+" "+a[n]),i.join(" ")}function w(e){if(0n===e)return"nol";if(e<1000n)return b(Number(e));if(e<1000000n){const n=Number(e/1000n),t=Number(e%1000n);let r;return r=1===n?"se"+f:b(n)+" "+f,t>0&&(r+=" "+b(t)),r}return function(e){const n=e.toString(),t=n.length,r=[],i=t%3;let s=0;for(i>0&&(r.push(Number(n.slice(0,i))),s=i);s<t;)r.push(Number(n.slice(s,s+3))),s+=3;const o=[];let u=r.length-1;for(let e=0;e<r.length;e++){const n=r[e];if(0!==n)if(0===u)o.push(b(n));else if(1===u)o.push(1===n?"se"+f:b(n)+" "+f);else{const e=m[u-2];o.push(b(n)+" "+e)}u--}return o.join(" ")}(e)}const N={idID:function(e){const t=function(e){const t=typeof e;if("bigint"==typeof e){if(e<=0n)throw new RangeError("Ordinals must be positive integers");return e}if("number"==typeof e){if(!Number.isFinite(e))throw new RangeError("Ordinals must be finite numbers");if(!Number.isInteger(e))throw new RangeError("Ordinals must be whole numbers");if(e<=0)throw new RangeError("Ordinals must be positive integers");return BigInt(e)}if("string"==typeof e)return function(e){const t=e.trim();if(0===t.length)throw new RangeError("Ordinals cannot be empty strings");if("-"===t[0])throw new RangeError("Ordinals cannot be negative");if(t.includes("."))throw new RangeError("Ordinals must be whole numbers");if(r(t)){const e=n(t);if(e.includes("."))throw new RangeError("Ordinals must be whole numbers");const r=BigInt(e);if(r<=0n)throw new RangeError("Ordinals must be positive integers");return r}try{const e=BigInt(t);if(e<=0n)throw new RangeError("Ordinals must be positive integers");return e}catch(n){if(n instanceof RangeError)throw n;throw new RangeError(`Invalid ordinal format: "${e}"`,{cause:n})}}(e);throw new TypeError(`Invalid value type: expected number, string, or bigint, received ${t}`)}(e);return o(t,d),1n===(i=t)?"pertama":"ke"+w(i);var i}};e.currency={idID:function(e){const{isNegative:n,dollars:r}=function(e){const n=typeof e;if("bigint"==typeof e)return e<0n?{isNegative:!0,dollars:-e,cents:0n}:{isNegative:!1,dollars:e,cents:0n};if("number"==typeof e){if(!Number.isFinite(e))throw new RangeError("Currency must be a finite number");return Number.isSafeInteger(e)?e<0?{isNegative:!0,dollars:BigInt(-e),cents:0n}:{isNegative:!1,dollars:BigInt(e),cents:0n}:s(t(e))}if("string"==typeof e)return s(e);throw new TypeError(`Invalid value type: expected number, string, or bigint, received ${n}`)}(e);o(r,h);let i="";return n&&(i="min "),i+=w(r),i+=" rupiah",i}},e.idID=function(e){const{isNegative:s,integerPart:u,decimalPart:a}=function(e){const s=typeof e;if("bigint"==typeof e)return e<0n?{isNegative:!0,integerPart:-e}:{isNegative:!1,integerPart:e};if("number"==typeof e){if(!Number.isFinite(e))throw new RangeError("Number must be finite (NaN and Infinity are not supported)");return Number.isSafeInteger(e)?e<0?{isNegative:!0,integerPart:BigInt(-e)}:{isNegative:!1,integerPart:BigInt(e)}:i(t(e))}if("string"==typeof e)return i(function(e){const t=e.trim();if(0===t.length||Number.isNaN(Number(t)))throw new RangeError(`Invalid number format: "${e}"`);return r(t)?n(t):t}(e));throw new TypeError(`Invalid value type: expected number, string, or bigint, received ${s}`)}(e);o(u,p,a);let l="";return s&&(l="min "),l+=w(u),a&&(l+=" koma "+function(e){let n="",t=0;for(;t<e.length&&"0"===e[t];)n&&(n+=" "),n+="nol",t++;const r=e.slice(t);return r&&(n&&(n+=" "),n+=w(BigInt(r))),n}(a)),l},e.ordinal=N},"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((e="undefined"!=typeof globalThis?globalThis:e||self).n2words=e.n2words||{});
package/dist/it-IT.js CHANGED
@@ -1,2 +1,2 @@
1
- /*! n2words/it-IT v5.1.0 | MIT License | github.com/forzagreen/n2words */
1
+ /*! n2words/it-IT v5.1.1 | MIT License | github.com/forzagreen/n2words */
2
2
  function e(e){let[t,n]=e.toLowerCase().split("e");const r=parseInt(n,10);let i="";"-"===t[0]&&(i="-",t=t.slice(1));const o=t.indexOf("."),s=-1===o?t:t.slice(0,o)+t.slice(o+1),u=(-1===o?t.length:o)+r;return u>=s.length?i+s+"0".repeat(u-s.length):u<=0?i+"0."+"0".repeat(-u)+s:i+s.slice(0,u)+"."+s.slice(u)}function t(t){const r=t.toString();return n(r)?e(r):r}function n(e){return e.includes("e")||e.includes("E")}function r(e){const t="-"===e[0];t&&(e=e.slice(1));const n=e.indexOf(".");if(-1===n)return{isNegative:t,integerPart:BigInt(e)};const r=e.slice(0,n)||"0",i=e.slice(n+1);return{isNegative:t,integerPart:BigInt(r),decimalPart:i}}function i(t){let r=t.trim();if(0===r.length||Number.isNaN(Number(r)))throw new RangeError(`Invalid currency format: "${t}"`);n(r)&&(r=e(r));const i="-"===r[0];i&&(r=r.slice(1));const o=r.indexOf(".");if(-1===o)return{isNegative:i,dollars:BigInt(r),cents:0n};const s=r.slice(0,o)||"0",u=(r.slice(o+1)+"00").slice(0,2);return{isNegative:i,dollars:BigInt(s),cents:BigInt(u)}}function o(e,t,n){if(null===t)return;if(e<t&&!(n&&BigInt(n)>=t))return;const r=t.toString().length-1,i=t===10n**BigInt(r)?`10^${r} - 1`:""+(t-1n);throw new RangeError(`Number too large to convert: the largest supported value is ${i}`)}function s(e){return 10n**BigInt(6*(e+1))}const u=["","uno","due","tre","quattro","cinque","sei","sette","otto","nove"],c=["dieci","undici","dodici","tredici","quattordici","quindici","sedici","diciassette","diciotto","diciannove"],a=["","","venti","trenta","quaranta","cinquanta","sessanta","settanta","ottanta","novanta"],f=["","cento","duecento","trecento","quattrocento","cinquecento","seicento","settecento","ottocento","novecento"],l=["","","vent","trent","quarant","cinquant","sessant","settant","ottant","novant"],g="zero",d="meno",m=["m","b","tr","quadr","quint","sest","sett","ott","nov","dec"],b=s(m.length),p=s(m.length),h=s(m.length),w=["","primo","secondo","terzo","quarto","quinto","sesto","settimo","ottavo","nono","decimo"],v="esimo";function N(e){if(0===e)return"";const t=e%10,n=Math.trunc(e/10)%10,r=Math.trunc(e/100);let i="";return r>0&&(i=8===n||0===n&&8===t?f[r].slice(0,-1):f[r]),0===n&&0===t||(1===n?i+=c[t]:n>=2?i+=1===t||8===t?l[n]+u[t]:3===t?a[n]+"tré":t>0?a[n]+u[t]:a[n]:t>0&&(i+=3===t&&r>0?"tré":u[t])),i}function y(e){return 0===e?"":1===e?"un":N(e)}function I(e){return 0===e?"":1===e?"mille":N(e)+"mila"}function E(e){if(e<2)return"";const t=Math.trunc((e-2)/2),n=m[t];return n?n+((e-2)%2==1?"iliardo":"ilione"):""}function O(e){if(e<2)return"";const t=Math.trunc((e-2)/2),n=m[t];return n?n+((e-2)%2==1?"iliardi":"ilioni"):""}function B(e){if(0n===e)return g;if(e<1000n)return N(Number(e));if(e<1000000n){const t=Number(e/1000n),n=Number(e%1000n);return 0===n?I(t):I(t)+N(n)}return function(e){const t=[];let n=e,r=2,i=1000000n;for(;1000n*i<=n;)i*=1000n,r++;for(let e=r;e>=0;e--){const r=1000n**BigInt(e),i=n/r;if(n%=r,0n===i)continue;const o=Number(i);if(e>=2){const n=y(o),r=1n===i?E(e):O(e);t.push(n+" "+r)}else t.push(1===e?I(o):N(o))}return function(e){const t=e.length;if(0===t)return"";if(1===t)return e[0];const n=e[t-1];if(-1===n.indexOf(" ")){let r=e[0];for(let n=1;n<t-1;n++)r+=" "+e[n];return r+" e "+n}let r=e[0];for(let n=1;n<t;n++)r+=" "+e[n];return r}(t)}(e)}function R(i){const{isNegative:s,integerPart:u,decimalPart:c}=function(i){const o=typeof i;if("bigint"==typeof i)return i<0n?{isNegative:!0,integerPart:-i}:{isNegative:!1,integerPart:i};if("number"==typeof i){if(!Number.isFinite(i))throw new RangeError("Number must be finite (NaN and Infinity are not supported)");return Number.isSafeInteger(i)?i<0?{isNegative:!0,integerPart:BigInt(-i)}:{isNegative:!1,integerPart:BigInt(i)}:r(t(i))}if("string"==typeof i)return r(function(t){const r=t.trim();if(0===r.length||Number.isNaN(Number(r)))throw new RangeError(`Invalid number format: "${t}"`);return n(r)?e(r):r}(i));throw new TypeError(`Invalid value type: expected number, string, or bigint, received ${o}`)}(i);o(u,b,c);let a="";return s&&(a=d+" "),a+=B(u),c&&(a+=" virgola "+function(e){let t="",n=0;for(;n<e.length&&"0"===e[n];)t&&(t+=" "),t+=g,n++;const r=e.slice(n);return r&&(t&&(t+=" "),t+=B(BigInt(r))),t}(c)),a}function q(t){const r=function(t){const r=typeof t;if("bigint"==typeof t){if(t<=0n)throw new RangeError("Ordinals must be positive integers");return t}if("number"==typeof t){if(!Number.isFinite(t))throw new RangeError("Ordinals must be finite numbers");if(!Number.isInteger(t))throw new RangeError("Ordinals must be whole numbers");if(t<=0)throw new RangeError("Ordinals must be positive integers");return BigInt(t)}if("string"==typeof t)return function(t){const r=t.trim();if(0===r.length)throw new RangeError("Ordinals cannot be empty strings");if("-"===r[0])throw new RangeError("Ordinals cannot be negative");if(r.includes("."))throw new RangeError("Ordinals must be whole numbers");if(n(r)){const t=e(r);if(t.includes("."))throw new RangeError("Ordinals must be whole numbers");const n=BigInt(t);if(n<=0n)throw new RangeError("Ordinals must be positive integers");return n}try{const e=BigInt(r);if(e<=0n)throw new RangeError("Ordinals must be positive integers");return e}catch(e){if(e instanceof RangeError)throw e;throw new RangeError(`Invalid ordinal format: "${t}"`,{cause:e})}}(t);throw new TypeError(`Invalid value type: expected number, string, or bigint, received ${r}`)}(t);return o(r,p),(i=r)<=10n?w[Number(i)]:function(e){if(e.endsWith("é"))return e.slice(0,-1)+"e"+v;if(e.endsWith("mila"))return e.slice(0,-4)+"mill"+v;if(e.endsWith("mille"))return e.slice(0,-1)+v;if(e.endsWith("ardo")||e.endsWith("ardi"))return e.slice(0,-1)+"i"+v;const t=e.slice(-1);return"aeiouàèìòù".includes(t)?e.slice(0,-1)+v:e+v}(B(i));var i}const $={and:!0};function x(e,n){const{isNegative:r,dollars:s,cents:u}=function(e){const n=typeof e;if("bigint"==typeof e)return e<0n?{isNegative:!0,dollars:-e,cents:0n}:{isNegative:!1,dollars:e,cents:0n};if("number"==typeof e){if(!Number.isFinite(e))throw new RangeError("Currency must be a finite number");return Number.isSafeInteger(e)?e<0?{isNegative:!0,dollars:BigInt(-e),cents:0n}:{isNegative:!1,dollars:BigInt(e),cents:0n}:i(t(e))}if("string"==typeof e)return i(e);throw new TypeError(`Invalid value type: expected number, string, or bigint, received ${n}`)}(e);o(s,h);const{and:c}=function(e,t){const n={...t};if(void 0===e)return n;if(!function(e){if(null===e||"object"!=typeof e)return!1;const t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}(e))throw new TypeError("Invalid options: expected plain object or undefined, got "+typeof e);const r=Object.keys(t);for(const[i,o]of Object.entries(e)){if(!Object.hasOwn(t,i))throw new TypeError(`Unknown option "${i}" — expected one of: ${r.join(", ")}`);if(void 0!==o){if(typeof o!=typeof n[i])throw new TypeError(`Option "${i}" must be a ${typeof n[i]}, got ${typeof o}`);n[i]=o}}return n}(n,$);let a="";return r&&(a=d+" "),(s>0n||0n===u)&&(a+=1n===s?"un":B(s),a+=" euro"),u>0n&&(s>0n&&(a+=c?" e ":" "),a+=1n===u?"un":B(u),a+=" "+(1n===u?"centesimo":"centesimi")),a}export{b as cardinalMax,$ as currencyDefaults,h as currencyMax,p as ordinalMax,R as toCardinal,x as toCurrency,q as toOrdinal};
package/dist/it-IT.umd.js CHANGED
@@ -1,2 +1,2 @@
1
- /*! n2words/it-IT v5.1.0 | MIT License | github.com/forzagreen/n2words */
1
+ /*! n2words/it-IT v5.1.1 | MIT License | github.com/forzagreen/n2words */
2
2
  var e,t;e=this,t=function(e){"use strict";function t(e){let[t,n]=e.toLowerCase().split("e");const r=parseInt(n,10);let i="";"-"===t[0]&&(i="-",t=t.slice(1));const o=t.indexOf("."),s=-1===o?t:t.slice(0,o)+t.slice(o+1),u=(-1===o?t.length:o)+r;return u>=s.length?i+s+"0".repeat(u-s.length):u<=0?i+"0."+"0".repeat(-u)+s:i+s.slice(0,u)+"."+s.slice(u)}function n(e){const n=e.toString();return r(n)?t(n):n}function r(e){return e.includes("e")||e.includes("E")}function i(e){const t="-"===e[0];t&&(e=e.slice(1));const n=e.indexOf(".");if(-1===n)return{isNegative:t,integerPart:BigInt(e)};const r=e.slice(0,n)||"0",i=e.slice(n+1);return{isNegative:t,integerPart:BigInt(r),decimalPart:i}}function o(e){let n=e.trim();if(0===n.length||Number.isNaN(Number(n)))throw new RangeError(`Invalid currency format: "${e}"`);r(n)&&(n=t(n));const i="-"===n[0];i&&(n=n.slice(1));const o=n.indexOf(".");if(-1===o)return{isNegative:i,dollars:BigInt(n),cents:0n};const s=n.slice(0,o)||"0",u=(n.slice(o+1)+"00").slice(0,2);return{isNegative:i,dollars:BigInt(s),cents:BigInt(u)}}function s(e,t,n){if(null===t)return;if(e<t&&!(n&&BigInt(n)>=t))return;const r=t.toString().length-1,i=t===10n**BigInt(r)?`10^${r} - 1`:""+(t-1n);throw new RangeError(`Number too large to convert: the largest supported value is ${i}`)}function u(e){return 10n**BigInt(6*(e+1))}const c=["","uno","due","tre","quattro","cinque","sei","sette","otto","nove"],a=["dieci","undici","dodici","tredici","quattordici","quindici","sedici","diciassette","diciotto","diciannove"],f=["","","venti","trenta","quaranta","cinquanta","sessanta","settanta","ottanta","novanta"],l=["","cento","duecento","trecento","quattrocento","cinquecento","seicento","settecento","ottocento","novecento"],g=["","","vent","trent","quarant","cinquant","sessant","settant","ottant","novant"],d="zero",m="meno",p=["m","b","tr","quadr","quint","sest","sett","ott","nov","dec"],b=u(p.length),h=u(p.length),w=u(p.length),v=["","primo","secondo","terzo","quarto","quinto","sesto","settimo","ottavo","nono","decimo"],y="esimo";function N(e){if(0===e)return"";const t=e%10,n=Math.trunc(e/10)%10,r=Math.trunc(e/100);let i="";return r>0&&(i=8===n||0===n&&8===t?l[r].slice(0,-1):l[r]),0===n&&0===t||(1===n?i+=a[t]:n>=2?i+=1===t||8===t?g[n]+c[t]:3===t?f[n]+"tré":t>0?f[n]+c[t]:f[n]:t>0&&(i+=3===t&&r>0?"tré":c[t])),i}function I(e){return 0===e?"":1===e?"un":N(e)}function E(e){return 0===e?"":1===e?"mille":N(e)+"mila"}function O(e){if(e<2)return"";const t=Math.trunc((e-2)/2),n=p[t];return n?n+((e-2)%2==1?"iliardo":"ilione"):""}function B(e){if(e<2)return"";const t=Math.trunc((e-2)/2),n=p[t];return n?n+((e-2)%2==1?"iliardi":"ilioni"):""}function R(e){if(0n===e)return d;if(e<1000n)return N(Number(e));if(e<1000000n){const t=Number(e/1000n),n=Number(e%1000n);return 0===n?E(t):E(t)+N(n)}return function(e){const t=[];let n=e,r=2,i=1000000n;for(;1000n*i<=n;)i*=1000n,r++;for(let e=r;e>=0;e--){const r=1000n**BigInt(e),i=n/r;if(n%=r,0n===i)continue;const o=Number(i);if(e>=2){const n=I(o),r=1n===i?O(e):B(e);t.push(n+" "+r)}else t.push(1===e?E(o):N(o))}return function(e){const t=e.length;if(0===t)return"";if(1===t)return e[0];const n=e[t-1];if(-1===n.indexOf(" ")){let r=e[0];for(let n=1;n<t-1;n++)r+=" "+e[n];return r+" e "+n}let r=e[0];for(let n=1;n<t;n++)r+=" "+e[n];return r}(t)}(e)}const q={and:!0},$={itIT:function(e){const n=function(e){const n=typeof e;if("bigint"==typeof e){if(e<=0n)throw new RangeError("Ordinals must be positive integers");return e}if("number"==typeof e){if(!Number.isFinite(e))throw new RangeError("Ordinals must be finite numbers");if(!Number.isInteger(e))throw new RangeError("Ordinals must be whole numbers");if(e<=0)throw new RangeError("Ordinals must be positive integers");return BigInt(e)}if("string"==typeof e)return function(e){const n=e.trim();if(0===n.length)throw new RangeError("Ordinals cannot be empty strings");if("-"===n[0])throw new RangeError("Ordinals cannot be negative");if(n.includes("."))throw new RangeError("Ordinals must be whole numbers");if(r(n)){const e=t(n);if(e.includes("."))throw new RangeError("Ordinals must be whole numbers");const r=BigInt(e);if(r<=0n)throw new RangeError("Ordinals must be positive integers");return r}try{const e=BigInt(n);if(e<=0n)throw new RangeError("Ordinals must be positive integers");return e}catch(t){if(t instanceof RangeError)throw t;throw new RangeError(`Invalid ordinal format: "${e}"`,{cause:t})}}(e);throw new TypeError(`Invalid value type: expected number, string, or bigint, received ${n}`)}(e);return s(n,h),(i=n)<=10n?v[Number(i)]:function(e){if(e.endsWith("é"))return e.slice(0,-1)+"e"+y;if(e.endsWith("mila"))return e.slice(0,-4)+"mill"+y;if(e.endsWith("mille"))return e.slice(0,-1)+y;if(e.endsWith("ardo")||e.endsWith("ardi"))return e.slice(0,-1)+"i"+y;const t=e.slice(-1);return"aeiouàèìòù".includes(t)?e.slice(0,-1)+y:e+y}(R(i));var i}};e.currency={itIT:function(e,t){const{isNegative:r,dollars:i,cents:u}=function(e){const t=typeof e;if("bigint"==typeof e)return e<0n?{isNegative:!0,dollars:-e,cents:0n}:{isNegative:!1,dollars:e,cents:0n};if("number"==typeof e){if(!Number.isFinite(e))throw new RangeError("Currency must be a finite number");return Number.isSafeInteger(e)?e<0?{isNegative:!0,dollars:BigInt(-e),cents:0n}:{isNegative:!1,dollars:BigInt(e),cents:0n}:o(n(e))}if("string"==typeof e)return o(e);throw new TypeError(`Invalid value type: expected number, string, or bigint, received ${t}`)}(e);s(i,w);const{and:c}=function(e,t){const n={...t};if(void 0===e)return n;if(!function(e){if(null===e||"object"!=typeof e)return!1;const t=Object.getPrototypeOf(e);return null===t||t===Object.prototype}(e))throw new TypeError("Invalid options: expected plain object or undefined, got "+typeof e);const r=Object.keys(t);for(const[i,o]of Object.entries(e)){if(!Object.hasOwn(t,i))throw new TypeError(`Unknown option "${i}" — expected one of: ${r.join(", ")}`);if(void 0!==o){if(typeof o!=typeof n[i])throw new TypeError(`Option "${i}" must be a ${typeof n[i]}, got ${typeof o}`);n[i]=o}}return n}(t,q);let a="";return r&&(a=m+" "),(i>0n||0n===u)&&(a+=1n===i?"un":R(i),a+=" euro"),u>0n&&(i>0n&&(a+=c?" e ":" "),a+=1n===u?"un":R(u),a+=" "+(1n===u?"centesimo":"centesimi")),a}},e.itIT=function(e){const{isNegative:o,integerPart:u,decimalPart:c}=function(e){const o=typeof e;if("bigint"==typeof e)return e<0n?{isNegative:!0,integerPart:-e}:{isNegative:!1,integerPart:e};if("number"==typeof e){if(!Number.isFinite(e))throw new RangeError("Number must be finite (NaN and Infinity are not supported)");return Number.isSafeInteger(e)?e<0?{isNegative:!0,integerPart:BigInt(-e)}:{isNegative:!1,integerPart:BigInt(e)}:i(n(e))}if("string"==typeof e)return i(function(e){const n=e.trim();if(0===n.length||Number.isNaN(Number(n)))throw new RangeError(`Invalid number format: "${e}"`);return r(n)?t(n):n}(e));throw new TypeError(`Invalid value type: expected number, string, or bigint, received ${o}`)}(e);s(u,b,c);let a="";return o&&(a=m+" "),a+=R(u),c&&(a+=" virgola "+function(e){let t="",n=0;for(;n<e.length&&"0"===e[n];)t&&(t+=" "),t+=d,n++;const r=e.slice(n);return r&&(t&&(t+=" "),t+=R(BigInt(r))),t}(c)),a},e.ordinal=$},"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).n2words=e.n2words||{});
package/dist/ja-JP.js CHANGED
@@ -1,2 +1,2 @@
1
- /*! n2words/ja-JP v5.1.0 | MIT License | github.com/forzagreen/n2words */
1
+ /*! n2words/ja-JP v5.1.1 | MIT License | github.com/forzagreen/n2words */
2
2
  function e(e){let[n,t]=e.toLowerCase().split("e");const r=parseInt(t,10);let i="";"-"===n[0]&&(i="-",n=n.slice(1));const o=n.indexOf("."),s=-1===o?n:n.slice(0,o)+n.slice(o+1),u=(-1===o?n.length:o)+r;return u>=s.length?i+s+"0".repeat(u-s.length):u<=0?i+"0."+"0".repeat(-u)+s:i+s.slice(0,u)+"."+s.slice(u)}function n(n){const r=n.toString();return t(r)?e(r):r}function t(e){return e.includes("e")||e.includes("E")}function r(e){const n="-"===e[0];n&&(e=e.slice(1));const t=e.indexOf(".");if(-1===t)return{isNegative:n,integerPart:BigInt(e)};const r=e.slice(0,t)||"0",i=e.slice(t+1);return{isNegative:n,integerPart:BigInt(r),decimalPart:i}}function i(n){let r=n.trim();if(0===r.length||Number.isNaN(Number(r)))throw new RangeError(`Invalid currency format: "${n}"`);t(r)&&(r=e(r));const i="-"===r[0];i&&(r=r.slice(1));const o=r.indexOf(".");if(-1===o)return{isNegative:i,dollars:BigInt(r),cents:0n};const s=r.slice(0,o)||"0",u=(r.slice(o+1)+"00").slice(0,2);return{isNegative:i,dollars:BigInt(s),cents:BigInt(u)}}function o(e,n,t){if(null===n)return;if(e<n)return;const r=n.toString().length-1,i=n===10n**BigInt(r)?`10^${r} - 1`:""+(n-1n);throw new RangeError(`Number too large to convert: the largest supported value is ${i}`)}function s(e){return 10n**BigInt(4*(e+1))}const u=["","一","二","三","四","五","六","七","八","九"],a=["万","億","兆","京","垓","秭","穣","溝","澗","正","載","極","恒河沙","阿僧祇","那由他","不可思議","無量大数"],c=s(a.length),g=s(a.length),l=s(a.length),f="マイナス";function m(e){if(0===e)return"";const n=e%10,t=Math.trunc(e/10)%10,r=Math.trunc(e/100)%10,i=Math.trunc(e/1e3);let o="";return i>0&&(o+=1===i?"千":u[i]+"千"),r>0&&(o+=1===r?"百":u[r]+"百"),t>0&&(o+=1===t?"十":u[t]+"十"),n>0&&(o+=u[n]),o}function b(e){if(0n===e)return"零";if(e<10000n)return m(Number(e));if(e<100000000n){const n=Number(e/10000n),t=Number(e%10000n);let r;return r=1===n?"一"+a[0]:m(n)+a[0],t>0&&(r+=m(t)),r}return function(e){const n=[];let t=e;for(;t>0n;)n.push(Number(t%10000n)),t/=10000n;let r="";for(let e=n.length-1;e>=0;e--){const t=n[e];0!==t&&(r+=e>0?1===t?"一"+a[e-1]:m(t)+a[e-1]:m(t))}return r||"零"}(e)}function w(i){const{isNegative:s,integerPart:a,decimalPart:g}=function(i){const o=typeof i;if("bigint"==typeof i)return i<0n?{isNegative:!0,integerPart:-i}:{isNegative:!1,integerPart:i};if("number"==typeof i){if(!Number.isFinite(i))throw new RangeError("Number must be finite (NaN and Infinity are not supported)");return Number.isSafeInteger(i)?i<0?{isNegative:!0,integerPart:BigInt(-i)}:{isNegative:!1,integerPart:BigInt(i)}:r(n(i))}if("string"==typeof i)return r(function(n){const r=n.trim();if(0===r.length||Number.isNaN(Number(r)))throw new RangeError(`Invalid number format: "${n}"`);return t(r)?e(r):r}(i));throw new TypeError(`Invalid value type: expected number, string, or bigint, received ${o}`)}(i);o(a,c);let l="";return s&&(l=f),l+=b(a),g&&(l+="点"+function(e){let n="";for(let t=0;t<e.length;t++){const r=parseInt(e[t],10);n+=0===r?"零":u[r]}return n}(g)),l}function d(n){const r=function(n){const r=typeof n;if("bigint"==typeof n){if(n<=0n)throw new RangeError("Ordinals must be positive integers");return n}if("number"==typeof n){if(!Number.isFinite(n))throw new RangeError("Ordinals must be finite numbers");if(!Number.isInteger(n))throw new RangeError("Ordinals must be whole numbers");if(n<=0)throw new RangeError("Ordinals must be positive integers");return BigInt(n)}if("string"==typeof n)return function(n){const r=n.trim();if(0===r.length)throw new RangeError("Ordinals cannot be empty strings");if("-"===r[0])throw new RangeError("Ordinals cannot be negative");if(r.includes("."))throw new RangeError("Ordinals must be whole numbers");if(t(r)){const n=e(r);if(n.includes("."))throw new RangeError("Ordinals must be whole numbers");const t=BigInt(n);if(t<=0n)throw new RangeError("Ordinals must be positive integers");return t}try{const e=BigInt(r);if(e<=0n)throw new RangeError("Ordinals must be positive integers");return e}catch(e){if(e instanceof RangeError)throw e;throw new RangeError(`Invalid ordinal format: "${n}"`,{cause:e})}}(n);throw new TypeError(`Invalid value type: expected number, string, or bigint, received ${r}`)}(n);return o(r,g),"第"+b(r)}function h(e){const{isNegative:t,dollars:r,cents:s}=function(e){const t=typeof e;if("bigint"==typeof e)return e<0n?{isNegative:!0,dollars:-e,cents:0n}:{isNegative:!1,dollars:e,cents:0n};if("number"==typeof e){if(!Number.isFinite(e))throw new RangeError("Currency must be a finite number");return Number.isSafeInteger(e)?e<0?{isNegative:!0,dollars:BigInt(-e),cents:0n}:{isNegative:!1,dollars:BigInt(e),cents:0n}:i(n(e))}if("string"==typeof e)return i(e);throw new TypeError(`Invalid value type: expected number, string, or bigint, received ${t}`)}(e);o(r,l);let u="";return t&&(u=f),r>0n&&(u+=b(r)+"円"),s>0n&&(u+=b(s)+"銭"),0n===r&&0n===s&&(u+="零円"),u}export{c as cardinalMax,l as currencyMax,g as ordinalMax,w as toCardinal,h as toCurrency,d as toOrdinal};
package/dist/ja-JP.umd.js CHANGED
@@ -1,2 +1,2 @@
1
- /*! n2words/ja-JP v5.1.0 | MIT License | github.com/forzagreen/n2words */
1
+ /*! n2words/ja-JP v5.1.1 | MIT License | github.com/forzagreen/n2words */
2
2
  var e,n;e=this,n=function(e){"use strict";function n(e){let[n,t]=e.toLowerCase().split("e");const r=parseInt(t,10);let i="";"-"===n[0]&&(i="-",n=n.slice(1));const o=n.indexOf("."),s=-1===o?n:n.slice(0,o)+n.slice(o+1),u=(-1===o?n.length:o)+r;return u>=s.length?i+s+"0".repeat(u-s.length):u<=0?i+"0."+"0".repeat(-u)+s:i+s.slice(0,u)+"."+s.slice(u)}function t(e){const t=e.toString();return r(t)?n(t):t}function r(e){return e.includes("e")||e.includes("E")}function i(e){const n="-"===e[0];n&&(e=e.slice(1));const t=e.indexOf(".");if(-1===t)return{isNegative:n,integerPart:BigInt(e)};const r=e.slice(0,t)||"0",i=e.slice(t+1);return{isNegative:n,integerPart:BigInt(r),decimalPart:i}}function o(e){let t=e.trim();if(0===t.length||Number.isNaN(Number(t)))throw new RangeError(`Invalid currency format: "${e}"`);r(t)&&(t=n(t));const i="-"===t[0];i&&(t=t.slice(1));const o=t.indexOf(".");if(-1===o)return{isNegative:i,dollars:BigInt(t),cents:0n};const s=t.slice(0,o)||"0",u=(t.slice(o+1)+"00").slice(0,2);return{isNegative:i,dollars:BigInt(s),cents:BigInt(u)}}function s(e,n,t){if(null===n)return;if(e<n)return;const r=n.toString().length-1,i=n===10n**BigInt(r)?`10^${r} - 1`:""+(n-1n);throw new RangeError(`Number too large to convert: the largest supported value is ${i}`)}function u(e){return 10n**BigInt(4*(e+1))}const a=["","一","二","三","四","五","六","七","八","九"],c=["万","億","兆","京","垓","秭","穣","溝","澗","正","載","極","恒河沙","阿僧祇","那由他","不可思議","無量大数"],f=u(c.length),l=u(c.length),g=u(c.length),d="マイナス";function b(e){if(0===e)return"";const n=e%10,t=Math.trunc(e/10)%10,r=Math.trunc(e/100)%10,i=Math.trunc(e/1e3);let o="";return i>0&&(o+=1===i?"千":a[i]+"千"),r>0&&(o+=1===r?"百":a[r]+"百"),t>0&&(o+=1===t?"十":a[t]+"十"),n>0&&(o+=a[n]),o}function m(e){if(0n===e)return"零";if(e<10000n)return b(Number(e));if(e<100000000n){const n=Number(e/10000n),t=Number(e%10000n);let r;return r=1===n?"一"+c[0]:b(n)+c[0],t>0&&(r+=b(t)),r}return function(e){const n=[];let t=e;for(;t>0n;)n.push(Number(t%10000n)),t/=10000n;let r="";for(let e=n.length-1;e>=0;e--){const t=n[e];0!==t&&(r+=e>0?1===t?"一"+c[e-1]:b(t)+c[e-1]:b(t))}return r||"零"}(e)}const w={jaJP:function(e){const t=function(e){const t=typeof e;if("bigint"==typeof e){if(e<=0n)throw new RangeError("Ordinals must be positive integers");return e}if("number"==typeof e){if(!Number.isFinite(e))throw new RangeError("Ordinals must be finite numbers");if(!Number.isInteger(e))throw new RangeError("Ordinals must be whole numbers");if(e<=0)throw new RangeError("Ordinals must be positive integers");return BigInt(e)}if("string"==typeof e)return function(e){const t=e.trim();if(0===t.length)throw new RangeError("Ordinals cannot be empty strings");if("-"===t[0])throw new RangeError("Ordinals cannot be negative");if(t.includes("."))throw new RangeError("Ordinals must be whole numbers");if(r(t)){const e=n(t);if(e.includes("."))throw new RangeError("Ordinals must be whole numbers");const r=BigInt(e);if(r<=0n)throw new RangeError("Ordinals must be positive integers");return r}try{const e=BigInt(t);if(e<=0n)throw new RangeError("Ordinals must be positive integers");return e}catch(n){if(n instanceof RangeError)throw n;throw new RangeError(`Invalid ordinal format: "${e}"`,{cause:n})}}(e);throw new TypeError(`Invalid value type: expected number, string, or bigint, received ${t}`)}(e);return s(t,l),"第"+m(t)}};e.currency={jaJP:function(e){const{isNegative:n,dollars:r,cents:i}=function(e){const n=typeof e;if("bigint"==typeof e)return e<0n?{isNegative:!0,dollars:-e,cents:0n}:{isNegative:!1,dollars:e,cents:0n};if("number"==typeof e){if(!Number.isFinite(e))throw new RangeError("Currency must be a finite number");return Number.isSafeInteger(e)?e<0?{isNegative:!0,dollars:BigInt(-e),cents:0n}:{isNegative:!1,dollars:BigInt(e),cents:0n}:o(t(e))}if("string"==typeof e)return o(e);throw new TypeError(`Invalid value type: expected number, string, or bigint, received ${n}`)}(e);s(r,g);let u="";return n&&(u=d),r>0n&&(u+=m(r)+"円"),i>0n&&(u+=m(i)+"銭"),0n===r&&0n===i&&(u+="零円"),u}},e.jaJP=function(e){const{isNegative:o,integerPart:u,decimalPart:c}=function(e){const o=typeof e;if("bigint"==typeof e)return e<0n?{isNegative:!0,integerPart:-e}:{isNegative:!1,integerPart:e};if("number"==typeof e){if(!Number.isFinite(e))throw new RangeError("Number must be finite (NaN and Infinity are not supported)");return Number.isSafeInteger(e)?e<0?{isNegative:!0,integerPart:BigInt(-e)}:{isNegative:!1,integerPart:BigInt(e)}:i(t(e))}if("string"==typeof e)return i(function(e){const t=e.trim();if(0===t.length||Number.isNaN(Number(t)))throw new RangeError(`Invalid number format: "${e}"`);return r(t)?n(t):t}(e));throw new TypeError(`Invalid value type: expected number, string, or bigint, received ${o}`)}(e);s(u,f);let l="";return o&&(l=d),l+=m(u),c&&(l+="点"+function(e){let n="";for(let t=0;t<e.length;t++){const r=parseInt(e[t],10);n+=0===r?"零":a[r]}return n}(c)),l},e.ordinal=w},"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((e="undefined"!=typeof globalThis?globalThis:e||self).n2words=e.n2words||{});
package/dist/ka-GE.js CHANGED
@@ -1,2 +1,2 @@
1
- /*! n2words/ka-GE v5.1.0 | MIT License | github.com/forzagreen/n2words */
1
+ /*! n2words/ka-GE v5.1.1 | MIT License | github.com/forzagreen/n2words */
2
2
  function e(e){let[n,t]=e.toLowerCase().split("e");const r=parseInt(t,10);let i="";"-"===n[0]&&(i="-",n=n.slice(1));const s=n.indexOf("."),o=-1===s?n:n.slice(0,s)+n.slice(s+1),u=(-1===s?n.length:s)+r;return u>=o.length?i+o+"0".repeat(u-o.length):u<=0?i+"0."+"0".repeat(-u)+o:i+o.slice(0,u)+"."+o.slice(u)}function n(n){const r=n.toString();return t(r)?e(r):r}function t(e){return e.includes("e")||e.includes("E")}function r(e){const n="-"===e[0];n&&(e=e.slice(1));const t=e.indexOf(".");if(-1===t)return{isNegative:n,integerPart:BigInt(e)};const r=e.slice(0,t)||"0",i=e.slice(t+1);return{isNegative:n,integerPart:BigInt(r),decimalPart:i}}function i(n){let r=n.trim();if(0===r.length||Number.isNaN(Number(r)))throw new RangeError(`Invalid currency format: "${n}"`);t(r)&&(r=e(r));const i="-"===r[0];i&&(r=r.slice(1));const s=r.indexOf(".");if(-1===s)return{isNegative:i,dollars:BigInt(r),cents:0n};const o=r.slice(0,s)||"0",u=(r.slice(s+1)+"00").slice(0,2);return{isNegative:i,dollars:BigInt(o),cents:BigInt(u)}}function s(e,n,t){if(null===n)return;if(e<n&&!(t&&BigInt(t)>=n))return;const r=n.toString().length-1,i=n===10n**BigInt(r)?`10^${r} - 1`:""+(n-1n);throw new RangeError(`Number too large to convert: the largest supported value is ${i}`)}function o(e){return 10n**BigInt(3*(e+1))}const u=["ნული","ერთი","ორი","სამი","ოთხი","ხუთი","ექვსი","შვიდი","რვა","ცხრა"],c=["ათი","თერთმეტი","თორმეტი","ცამეტი","თოთხმეტი","თხუთმეტი","თექვსმეტი","ჩვიდმეტი","თვრამეტი","ცხრამეტი"],l=["","ოცი","ორმოცი","სამოცი","ოთხმოცი"],f=["","ოცდა","ორმოცდა","სამოცდა","ოთხმოცდა"],a=["","","ორ","სამ","ოთხ","ხუთ","ექვს","შვიდ","რვა","ცხრა"],g="ათასი",m="ათას",h=["","","მილიონი","მილიარდი","ტრილიონი","კვადრილიონი","კვინტილიონი","სექსტილიონი"],b=o(h.length-1),p=o(h.length-1),w=o(h.length-1),d="ნული",N="მინუს",v=["","პირველი","მეორე","მესამე","მეოთხე","მეხუთე","მეექვსე","მეშვიდე","მერვე","მეცხრე"];function I(e){if(e<10)return u[e];if(e<20)return c[e-10];const n=Math.trunc(e/20),t=e%20;if(0===t)return l[n];const r=f[n];return t<10?r+u[t]:r+c[t-10]}function y(e){if(0===e)return{full:"",stem:""};if(e<100){const n=I(e),t=n.slice(-1),r="ი"===t||"ა"===t?n.slice(0,-1):n;return{full:n,stem:r}}const n=Math.trunc(e/100),t=e%100;let r;if(r=1===n?t>0?"ას":"ასი":a[n]+(t>0?"ას":"ასი"),t>0){const e=I(t),n=r+" "+e,i=e.slice(-1);return{full:n,stem:r+" "+("ი"===i||"ა"===i?e.slice(0,-1):e)}}return{full:r,stem:r.slice(0,-1)}}function E(e){if(0n===e)return d;if(e<1000n){const{full:n}=y(Number(e));return n}if(e<1000000n){const n=Number(e/1000n),t=Number(e%1000n);let r;if(1===n)r=t>0?m:g;else{const{stem:e}=y(n);r=e+" "+(t>0?m:g)}if(t>0){const{full:e}=y(t);r+=" "+e}return r}return function(e){const n=e.toString(),t=n.length,r=[],i=t%3;let s=0;for(i>0&&(r.push(Number(n.slice(0,i))),s=i);s<t;)r.push(Number(n.slice(s,s+3))),s+=3;const o=[];let u=r.length-1;for(let e=0;e<r.length;e++){const n=r[e];if(0!==n)if(0===u){const{full:e}=y(n);o.push(e)}else if(1===u){const t=r.slice(e+1).some(e=>0!==e)?m:g;if(1===n)o.push(t);else{const{stem:e}=y(n);o.push(e+" "+t)}}else{const e=h[u]||h[h.length-1];if(1===n)o.push("ერთი "+e);else{const{full:t}=y(n);o.push(t+" "+e)}}u--}return o.join(" ")}(e)}function R(i){const{isNegative:o,integerPart:u,decimalPart:c}=function(i){const s=typeof i;if("bigint"==typeof i)return i<0n?{isNegative:!0,integerPart:-i}:{isNegative:!1,integerPart:i};if("number"==typeof i){if(!Number.isFinite(i))throw new RangeError("Number must be finite (NaN and Infinity are not supported)");return Number.isSafeInteger(i)?i<0?{isNegative:!0,integerPart:BigInt(-i)}:{isNegative:!1,integerPart:BigInt(i)}:r(n(i))}if("string"==typeof i)return r(function(n){const r=n.trim();if(0===r.length||Number.isNaN(Number(r)))throw new RangeError(`Invalid number format: "${n}"`);return t(r)?e(r):r}(i));throw new TypeError(`Invalid value type: expected number, string, or bigint, received ${s}`)}(i);s(u,b,c);let l="";return o&&(l=N+" "),l+=E(u),c&&(l+=" მთელი "+function(e){let n="",t=0;for(;t<e.length&&"0"===e[t];)n&&(n+=" "),n+=d,t++;const r=e.slice(t);return r&&(n&&(n+=" "),n+=E(BigInt(r))),n}(c)),l}function B(n){const r=function(n){const r=typeof n;if("bigint"==typeof n){if(n<=0n)throw new RangeError("Ordinals must be positive integers");return n}if("number"==typeof n){if(!Number.isFinite(n))throw new RangeError("Ordinals must be finite numbers");if(!Number.isInteger(n))throw new RangeError("Ordinals must be whole numbers");if(n<=0)throw new RangeError("Ordinals must be positive integers");return BigInt(n)}if("string"==typeof n)return function(n){const r=n.trim();if(0===r.length)throw new RangeError("Ordinals cannot be empty strings");if("-"===r[0])throw new RangeError("Ordinals cannot be negative");if(r.includes("."))throw new RangeError("Ordinals must be whole numbers");if(t(r)){const n=e(r);if(n.includes("."))throw new RangeError("Ordinals must be whole numbers");const t=BigInt(n);if(t<=0n)throw new RangeError("Ordinals must be positive integers");return t}try{const e=BigInt(r);if(e<=0n)throw new RangeError("Ordinals must be positive integers");return e}catch(e){if(e instanceof RangeError)throw e;throw new RangeError(`Invalid ordinal format: "${n}"`,{cause:e})}}(n);throw new TypeError(`Invalid value type: expected number, string, or bigint, received ${r}`)}(n);return s(r,p),function(e){if(0n===e)return"";if(e<=9n)return v[Number(e)];const n=E(e),t=n.slice(-1);let r;return r="ი"===t||"ა"===t?n.slice(0,-1):n,"მე"+r+"ე"}(r)}function O(e){const{isNegative:t,dollars:r,cents:o}=function(e){const t=typeof e;if("bigint"==typeof e)return e<0n?{isNegative:!0,dollars:-e,cents:0n}:{isNegative:!1,dollars:e,cents:0n};if("number"==typeof e){if(!Number.isFinite(e))throw new RangeError("Currency must be a finite number");return Number.isSafeInteger(e)?e<0?{isNegative:!0,dollars:BigInt(-e),cents:0n}:{isNegative:!1,dollars:BigInt(e),cents:0n}:i(n(e))}if("string"==typeof e)return i(e);throw new TypeError(`Invalid value type: expected number, string, or bigint, received ${t}`)}(e);s(r,w);const u=[];if(t&&u.push(N),r>0n||0n===o){const e=E(r);u.push(e+" ლარი")}if(o>0n){const e=E(o);u.push(e+" თეთრი")}return u.join(" ")}export{b as cardinalMax,w as currencyMax,p as ordinalMax,R as toCardinal,O as toCurrency,B as toOrdinal};
package/dist/ka-GE.umd.js CHANGED
@@ -1,2 +1,2 @@
1
- /*! n2words/ka-GE v5.1.0 | MIT License | github.com/forzagreen/n2words */
1
+ /*! n2words/ka-GE v5.1.1 | MIT License | github.com/forzagreen/n2words */
2
2
  var e,n;e=this,n=function(e){"use strict";function n(e){let[n,t]=e.toLowerCase().split("e");const r=parseInt(t,10);let i="";"-"===n[0]&&(i="-",n=n.slice(1));const s=n.indexOf("."),o=-1===s?n:n.slice(0,s)+n.slice(s+1),u=(-1===s?n.length:s)+r;return u>=o.length?i+o+"0".repeat(u-o.length):u<=0?i+"0."+"0".repeat(-u)+o:i+o.slice(0,u)+"."+o.slice(u)}function t(e){const t=e.toString();return r(t)?n(t):t}function r(e){return e.includes("e")||e.includes("E")}function i(e){const n="-"===e[0];n&&(e=e.slice(1));const t=e.indexOf(".");if(-1===t)return{isNegative:n,integerPart:BigInt(e)};const r=e.slice(0,t)||"0",i=e.slice(t+1);return{isNegative:n,integerPart:BigInt(r),decimalPart:i}}function s(e){let t=e.trim();if(0===t.length||Number.isNaN(Number(t)))throw new RangeError(`Invalid currency format: "${e}"`);r(t)&&(t=n(t));const i="-"===t[0];i&&(t=t.slice(1));const s=t.indexOf(".");if(-1===s)return{isNegative:i,dollars:BigInt(t),cents:0n};const o=t.slice(0,s)||"0",u=(t.slice(s+1)+"00").slice(0,2);return{isNegative:i,dollars:BigInt(o),cents:BigInt(u)}}function o(e,n,t){if(null===n)return;if(e<n&&!(t&&BigInt(t)>=n))return;const r=n.toString().length-1,i=n===10n**BigInt(r)?`10^${r} - 1`:""+(n-1n);throw new RangeError(`Number too large to convert: the largest supported value is ${i}`)}function u(e){return 10n**BigInt(3*(e+1))}const c=["ნული","ერთი","ორი","სამი","ოთხი","ხუთი","ექვსი","შვიდი","რვა","ცხრა"],l=["ათი","თერთმეტი","თორმეტი","ცამეტი","თოთხმეტი","თხუთმეტი","თექვსმეტი","ჩვიდმეტი","თვრამეტი","ცხრამეტი"],f=["","ოცი","ორმოცი","სამოცი","ოთხმოცი"],a=["","ოცდა","ორმოცდა","სამოცდა","ოთხმოცდა"],g=["","","ორ","სამ","ოთხ","ხუთ","ექვს","შვიდ","რვა","ცხრა"],m="ათასი",h="ათას",d=["","","მილიონი","მილიარდი","ტრილიონი","კვადრილიონი","კვინტილიონი","სექსტილიონი"],b=u(d.length-1),p=u(d.length-1),w=u(d.length-1),N="ნული",v="მინუს",y=["","პირველი","მეორე","მესამე","მეოთხე","მეხუთე","მეექვსე","მეშვიდე","მერვე","მეცხრე"];function I(e){if(e<10)return c[e];if(e<20)return l[e-10];const n=Math.trunc(e/20),t=e%20;if(0===t)return f[n];const r=a[n];return t<10?r+c[t]:r+l[t-10]}function E(e){if(0===e)return{full:"",stem:""};if(e<100){const n=I(e),t=n.slice(-1),r="ი"===t||"ა"===t?n.slice(0,-1):n;return{full:n,stem:r}}const n=Math.trunc(e/100),t=e%100;let r;if(r=1===n?t>0?"ას":"ასი":g[n]+(t>0?"ას":"ასი"),t>0){const e=I(t),n=r+" "+e,i=e.slice(-1);return{full:n,stem:r+" "+("ი"===i||"ა"===i?e.slice(0,-1):e)}}return{full:r,stem:r.slice(0,-1)}}function R(e){if(0n===e)return N;if(e<1000n){const{full:n}=E(Number(e));return n}if(e<1000000n){const n=Number(e/1000n),t=Number(e%1000n);let r;if(1===n)r=t>0?h:m;else{const{stem:e}=E(n);r=e+" "+(t>0?h:m)}if(t>0){const{full:e}=E(t);r+=" "+e}return r}return function(e){const n=e.toString(),t=n.length,r=[],i=t%3;let s=0;for(i>0&&(r.push(Number(n.slice(0,i))),s=i);s<t;)r.push(Number(n.slice(s,s+3))),s+=3;const o=[];let u=r.length-1;for(let e=0;e<r.length;e++){const n=r[e];if(0!==n)if(0===u){const{full:e}=E(n);o.push(e)}else if(1===u){const t=r.slice(e+1).some(e=>0!==e)?h:m;if(1===n)o.push(t);else{const{stem:e}=E(n);o.push(e+" "+t)}}else{const e=d[u]||d[d.length-1];if(1===n)o.push("ერთი "+e);else{const{full:t}=E(n);o.push(t+" "+e)}}u--}return o.join(" ")}(e)}const B={kaGE:function(e){const t=function(e){const t=typeof e;if("bigint"==typeof e){if(e<=0n)throw new RangeError("Ordinals must be positive integers");return e}if("number"==typeof e){if(!Number.isFinite(e))throw new RangeError("Ordinals must be finite numbers");if(!Number.isInteger(e))throw new RangeError("Ordinals must be whole numbers");if(e<=0)throw new RangeError("Ordinals must be positive integers");return BigInt(e)}if("string"==typeof e)return function(e){const t=e.trim();if(0===t.length)throw new RangeError("Ordinals cannot be empty strings");if("-"===t[0])throw new RangeError("Ordinals cannot be negative");if(t.includes("."))throw new RangeError("Ordinals must be whole numbers");if(r(t)){const e=n(t);if(e.includes("."))throw new RangeError("Ordinals must be whole numbers");const r=BigInt(e);if(r<=0n)throw new RangeError("Ordinals must be positive integers");return r}try{const e=BigInt(t);if(e<=0n)throw new RangeError("Ordinals must be positive integers");return e}catch(n){if(n instanceof RangeError)throw n;throw new RangeError(`Invalid ordinal format: "${e}"`,{cause:n})}}(e);throw new TypeError(`Invalid value type: expected number, string, or bigint, received ${t}`)}(e);return o(t,p),function(e){if(0n===e)return"";if(e<=9n)return y[Number(e)];const n=R(e),t=n.slice(-1);let r;return r="ი"===t||"ა"===t?n.slice(0,-1):n,"მე"+r+"ე"}(t)}};e.currency={kaGE:function(e){const{isNegative:n,dollars:r,cents:i}=function(e){const n=typeof e;if("bigint"==typeof e)return e<0n?{isNegative:!0,dollars:-e,cents:0n}:{isNegative:!1,dollars:e,cents:0n};if("number"==typeof e){if(!Number.isFinite(e))throw new RangeError("Currency must be a finite number");return Number.isSafeInteger(e)?e<0?{isNegative:!0,dollars:BigInt(-e),cents:0n}:{isNegative:!1,dollars:BigInt(e),cents:0n}:s(t(e))}if("string"==typeof e)return s(e);throw new TypeError(`Invalid value type: expected number, string, or bigint, received ${n}`)}(e);o(r,w);const u=[];if(n&&u.push(v),r>0n||0n===i){const e=R(r);u.push(e+" ლარი")}if(i>0n){const e=R(i);u.push(e+" თეთრი")}return u.join(" ")}},e.kaGE=function(e){const{isNegative:s,integerPart:u,decimalPart:c}=function(e){const s=typeof e;if("bigint"==typeof e)return e<0n?{isNegative:!0,integerPart:-e}:{isNegative:!1,integerPart:e};if("number"==typeof e){if(!Number.isFinite(e))throw new RangeError("Number must be finite (NaN and Infinity are not supported)");return Number.isSafeInteger(e)?e<0?{isNegative:!0,integerPart:BigInt(-e)}:{isNegative:!1,integerPart:BigInt(e)}:i(t(e))}if("string"==typeof e)return i(function(e){const t=e.trim();if(0===t.length||Number.isNaN(Number(t)))throw new RangeError(`Invalid number format: "${e}"`);return r(t)?n(t):t}(e));throw new TypeError(`Invalid value type: expected number, string, or bigint, received ${s}`)}(e);o(u,b,c);let l="";return s&&(l=v+" "),l+=R(u),c&&(l+=" მთელი "+function(e){let n="",t=0;for(;t<e.length&&"0"===e[t];)n&&(n+=" "),n+=N,t++;const r=e.slice(t);return r&&(n&&(n+=" "),n+=R(BigInt(r))),n}(c)),l},e.ordinal=B},"object"==typeof exports&&"undefined"!=typeof module?n(exports):"function"==typeof define&&define.amd?define(["exports"],n):n((e="undefined"!=typeof globalThis?globalThis:e||self).n2words=e.n2words||{});