@formatjs/intl-pluralrules 6.2.4 → 6.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (241) hide show
  1. package/index.d.ts +113 -65
  2. package/index.js +965 -64
  3. package/index.js.map +1 -0
  4. package/locale-data/af.js +15 -0
  5. package/locale-data/ak.js +15 -0
  6. package/locale-data/am.js +16 -0
  7. package/locale-data/an.js +15 -0
  8. package/locale-data/ar.js +23 -0
  9. package/locale-data/ars.js +23 -0
  10. package/locale-data/as.js +24 -0
  11. package/locale-data/asa.js +15 -0
  12. package/locale-data/ast.js +16 -0
  13. package/locale-data/az.js +22 -0
  14. package/locale-data/bal.js +17 -0
  15. package/locale-data/be.js +21 -0
  16. package/locale-data/bem.js +15 -0
  17. package/locale-data/bez.js +15 -0
  18. package/locale-data/bg.js +15 -0
  19. package/locale-data/bho.js +15 -0
  20. package/locale-data/bm.js +4 -0
  21. package/locale-data/bn.js +24 -0
  22. package/locale-data/bo.js +4 -0
  23. package/locale-data/br.js +21 -0
  24. package/locale-data/brx.js +15 -0
  25. package/locale-data/bs.js +19 -0
  26. package/locale-data/ca.js +26 -0
  27. package/locale-data/ce.js +15 -0
  28. package/locale-data/ceb.js +17 -0
  29. package/locale-data/cgg.js +15 -0
  30. package/locale-data/chr.js +15 -0
  31. package/locale-data/ckb.js +15 -0
  32. package/locale-data/cs.js +20 -0
  33. package/locale-data/cy.js +33 -0
  34. package/locale-data/da.js +18 -0
  35. package/locale-data/de.js +16 -0
  36. package/locale-data/doi.js +16 -0
  37. package/locale-data/dsb.js +21 -0
  38. package/locale-data/dv.js +15 -0
  39. package/locale-data/dz.js +4 -0
  40. package/locale-data/ee.js +15 -0
  41. package/locale-data/el.js +15 -0
  42. package/locale-data/en.js +23 -0
  43. package/locale-data/eo.js +15 -0
  44. package/locale-data/es.js +20 -0
  45. package/locale-data/et.js +16 -0
  46. package/locale-data/eu.js +15 -0
  47. package/locale-data/fa.js +16 -0
  48. package/locale-data/ff.js +15 -0
  49. package/locale-data/fi.js +16 -0
  50. package/locale-data/fil.js +20 -0
  51. package/locale-data/fo.js +15 -0
  52. package/locale-data/fr.js +22 -0
  53. package/locale-data/fur.js +15 -0
  54. package/locale-data/fy.js +16 -0
  55. package/locale-data/ga.js +23 -0
  56. package/locale-data/gd.js +25 -0
  57. package/locale-data/gl.js +16 -0
  58. package/locale-data/gsw.js +15 -0
  59. package/locale-data/gu.js +24 -0
  60. package/locale-data/guw.js +15 -0
  61. package/locale-data/gv.js +22 -0
  62. package/locale-data/ha.js +15 -0
  63. package/locale-data/haw.js +15 -0
  64. package/locale-data/he.js +18 -0
  65. package/locale-data/hi.js +24 -0
  66. package/locale-data/hnj.js +4 -0
  67. package/locale-data/hr.js +19 -0
  68. package/locale-data/hsb.js +21 -0
  69. package/locale-data/hu.js +17 -0
  70. package/locale-data/hy.js +18 -0
  71. package/locale-data/ia.js +16 -0
  72. package/locale-data/id.js +4 -0
  73. package/locale-data/ig.js +4 -0
  74. package/locale-data/ii.js +4 -0
  75. package/locale-data/io.js +16 -0
  76. package/locale-data/is.js +17 -0
  77. package/locale-data/it.js +22 -0
  78. package/locale-data/iu.js +17 -0
  79. package/locale-data/ja.js +4 -0
  80. package/locale-data/jbo.js +4 -0
  81. package/locale-data/jgo.js +15 -0
  82. package/locale-data/jmc.js +15 -0
  83. package/locale-data/jv.js +4 -0
  84. package/locale-data/jw.js +4 -0
  85. package/locale-data/ka.js +20 -0
  86. package/locale-data/kab.js +15 -0
  87. package/locale-data/kaj.js +15 -0
  88. package/locale-data/kcg.js +15 -0
  89. package/locale-data/kde.js +4 -0
  90. package/locale-data/kea.js +4 -0
  91. package/locale-data/kk.js +17 -0
  92. package/locale-data/kkj.js +15 -0
  93. package/locale-data/kl.js +15 -0
  94. package/locale-data/km.js +4 -0
  95. package/locale-data/kn.js +16 -0
  96. package/locale-data/ko.js +4 -0
  97. package/locale-data/ks.js +15 -0
  98. package/locale-data/ksb.js +15 -0
  99. package/locale-data/ksh.js +17 -0
  100. package/locale-data/ku.js +15 -0
  101. package/locale-data/kw.js +27 -0
  102. package/locale-data/ky.js +15 -0
  103. package/locale-data/lag.js +18 -0
  104. package/locale-data/lb.js +15 -0
  105. package/locale-data/lg.js +15 -0
  106. package/locale-data/lij.js +19 -0
  107. package/locale-data/lkt.js +4 -0
  108. package/locale-data/ln.js +15 -0
  109. package/locale-data/lo.js +15 -0
  110. package/locale-data/lt.js +21 -0
  111. package/locale-data/lv.js +19 -0
  112. package/locale-data/mas.js +15 -0
  113. package/locale-data/mg.js +15 -0
  114. package/locale-data/mgo.js +15 -0
  115. package/locale-data/mk.js +23 -0
  116. package/locale-data/ml.js +15 -0
  117. package/locale-data/mn.js +15 -0
  118. package/locale-data/mo.js +21 -0
  119. package/locale-data/mr.js +21 -0
  120. package/locale-data/ms.js +15 -0
  121. package/locale-data/mt.js +21 -0
  122. package/locale-data/my.js +4 -0
  123. package/locale-data/nah.js +15 -0
  124. package/locale-data/naq.js +17 -0
  125. package/locale-data/nb.js +15 -0
  126. package/locale-data/nd.js +15 -0
  127. package/locale-data/ne.js +17 -0
  128. package/locale-data/nl.js +16 -0
  129. package/locale-data/nn.js +15 -0
  130. package/locale-data/nnh.js +15 -0
  131. package/locale-data/no.js +15 -0
  132. package/locale-data/nqo.js +4 -0
  133. package/locale-data/nr.js +15 -0
  134. package/locale-data/nso.js +15 -0
  135. package/locale-data/ny.js +15 -0
  136. package/locale-data/nyn.js +15 -0
  137. package/locale-data/om.js +15 -0
  138. package/locale-data/or.js +23 -0
  139. package/locale-data/os.js +15 -0
  140. package/locale-data/osa.js +4 -0
  141. package/locale-data/pa.js +15 -0
  142. package/locale-data/pap.js +15 -0
  143. package/locale-data/pcm.js +16 -0
  144. package/locale-data/pl.js +20 -0
  145. package/locale-data/prg.js +19 -0
  146. package/locale-data/ps.js +15 -0
  147. package/locale-data/pt-PT.js +19 -0
  148. package/locale-data/pt.js +19 -0
  149. package/locale-data/rm.js +15 -0
  150. package/locale-data/ro.js +21 -0
  151. package/locale-data/rof.js +15 -0
  152. package/locale-data/ru.js +20 -0
  153. package/locale-data/rwk.js +15 -0
  154. package/locale-data/sah.js +4 -0
  155. package/locale-data/saq.js +15 -0
  156. package/locale-data/sat.js +17 -0
  157. package/locale-data/sc.js +19 -0
  158. package/locale-data/scn.js +22 -0
  159. package/locale-data/sd.js +15 -0
  160. package/locale-data/sdh.js +15 -0
  161. package/locale-data/se.js +17 -0
  162. package/locale-data/seh.js +15 -0
  163. package/locale-data/ses.js +4 -0
  164. package/locale-data/sg.js +4 -0
  165. package/locale-data/sh.js +19 -0
  166. package/locale-data/shi.js +18 -0
  167. package/locale-data/si.js +18 -0
  168. package/locale-data/sk.js +20 -0
  169. package/locale-data/sl.js +20 -0
  170. package/locale-data/sma.js +17 -0
  171. package/locale-data/smi.js +17 -0
  172. package/locale-data/smj.js +17 -0
  173. package/locale-data/smn.js +17 -0
  174. package/locale-data/sms.js +17 -0
  175. package/locale-data/sn.js +15 -0
  176. package/locale-data/so.js +15 -0
  177. package/locale-data/sq.js +19 -0
  178. package/locale-data/sr.js +19 -0
  179. package/locale-data/ss.js +15 -0
  180. package/locale-data/ssy.js +15 -0
  181. package/locale-data/st.js +15 -0
  182. package/locale-data/su.js +4 -0
  183. package/locale-data/sv.js +19 -0
  184. package/locale-data/sw.js +16 -0
  185. package/locale-data/syr.js +15 -0
  186. package/locale-data/ta.js +15 -0
  187. package/locale-data/te.js +15 -0
  188. package/locale-data/teo.js +15 -0
  189. package/locale-data/th.js +4 -0
  190. package/locale-data/ti.js +15 -0
  191. package/locale-data/tig.js +15 -0
  192. package/locale-data/tk.js +17 -0
  193. package/locale-data/tl.js +20 -0
  194. package/locale-data/tn.js +15 -0
  195. package/locale-data/to.js +4 -0
  196. package/locale-data/tpi.js +4 -0
  197. package/locale-data/tr.js +15 -0
  198. package/locale-data/ts.js +15 -0
  199. package/locale-data/tzm.js +15 -0
  200. package/locale-data/ug.js +15 -0
  201. package/locale-data/uk.js +23 -0
  202. package/locale-data/und.js +4 -0
  203. package/locale-data/ur.js +16 -0
  204. package/locale-data/uz.js +15 -0
  205. package/locale-data/ve.js +15 -0
  206. package/locale-data/vi.js +15 -0
  207. package/locale-data/vo.js +15 -0
  208. package/locale-data/vun.js +15 -0
  209. package/locale-data/wa.js +15 -0
  210. package/locale-data/wae.js +15 -0
  211. package/locale-data/wo.js +4 -0
  212. package/locale-data/xh.js +15 -0
  213. package/locale-data/xog.js +15 -0
  214. package/locale-data/yi.js +16 -0
  215. package/locale-data/yo.js +4 -0
  216. package/locale-data/yue.js +4 -0
  217. package/locale-data/zh.js +4 -0
  218. package/locale-data/zu.js +16 -0
  219. package/package.json +5 -6
  220. package/polyfill-force.d.ts +1 -1
  221. package/polyfill-force.js +1130 -1
  222. package/polyfill-force.js.map +1 -0
  223. package/polyfill.d.ts +1 -1
  224. package/polyfill.iife.js +5522 -7581
  225. package/polyfill.js +1359 -2
  226. package/polyfill.js.map +1 -0
  227. package/should-polyfill.d.ts +5 -1
  228. package/should-polyfill.js +227 -8
  229. package/should-polyfill.js.map +1 -0
  230. package/abstract/GetOperands.d.ts +0 -59
  231. package/abstract/GetOperands.js +0 -50
  232. package/abstract/InitializePluralRules.d.ts +0 -8
  233. package/abstract/InitializePluralRules.js +0 -31
  234. package/abstract/ResolvePlural.d.ts +0 -43
  235. package/abstract/ResolvePlural.js +0 -75
  236. package/abstract/ResolvePluralRange.d.ts +0 -23
  237. package/abstract/ResolvePluralRange.js +0 -59
  238. package/get_internal_slots.d.ts +0 -3
  239. package/get_internal_slots.js +0 -10
  240. package/supported-locales.generated.d.ts +0 -1
  241. package/supported-locales.generated.js +0 -217
package/locale-data/tr.js CHANGED
@@ -15,4 +15,19 @@ if (Intl.PluralRules && typeof Intl.PluralRules.__addLocaleData === 'function')
15
15
  }
16
16
  return "other";
17
17
  },"pluralRanges":{"cardinal":{"one_other":"other","other_one":"one","other_other":"other"},"ordinal":{}}},"locale":"tr"})
18
+ } else {
19
+ (globalThis.__FORMATJS_PLURALRULES_DATA__ = globalThis.__FORMATJS_PLURALRULES_DATA__ || []).push({"data":{"categories":{"cardinal":["one","other"],"ordinal":["other"]},"fn":function(num, isOrdinal, exponent = 0) {
20
+ const numStr = String(num);
21
+ const parts = numStr.split(".");
22
+ const integerPart = parts[0];
23
+ const decimalPart = parts[1] || "";
24
+ const n = Math.abs(parseFloat(numStr));
25
+ if (isOrdinal) {
26
+ }
27
+ else {
28
+ if (n === 1)
29
+ return "one";
30
+ }
31
+ return "other";
32
+ },"pluralRanges":{"cardinal":{"one_other":"other","other_one":"one","other_other":"other"},"ordinal":{}}},"locale":"tr"})
18
33
  }
package/locale-data/ts.js CHANGED
@@ -15,4 +15,19 @@ if (Intl.PluralRules && typeof Intl.PluralRules.__addLocaleData === 'function')
15
15
  }
16
16
  return "other";
17
17
  }},"locale":"ts"})
18
+ } else {
19
+ (globalThis.__FORMATJS_PLURALRULES_DATA__ = globalThis.__FORMATJS_PLURALRULES_DATA__ || []).push({"data":{"categories":{"cardinal":["one","other"],"ordinal":["other"]},"fn":function(num, isOrdinal, exponent = 0) {
20
+ const numStr = String(num);
21
+ const parts = numStr.split(".");
22
+ const integerPart = parts[0];
23
+ const decimalPart = parts[1] || "";
24
+ const n = Math.abs(parseFloat(numStr));
25
+ if (isOrdinal) {
26
+ }
27
+ else {
28
+ if (n === 1)
29
+ return "one";
30
+ }
31
+ return "other";
32
+ }},"locale":"ts"})
18
33
  }
@@ -15,4 +15,19 @@ if (Intl.PluralRules && typeof Intl.PluralRules.__addLocaleData === 'function')
15
15
  }
16
16
  return "other";
17
17
  }},"locale":"tzm"})
18
+ } else {
19
+ (globalThis.__FORMATJS_PLURALRULES_DATA__ = globalThis.__FORMATJS_PLURALRULES_DATA__ || []).push({"data":{"categories":{"cardinal":["one","other"],"ordinal":["other"]},"fn":function(num, isOrdinal, exponent = 0) {
20
+ const numStr = String(num);
21
+ const parts = numStr.split(".");
22
+ const integerPart = parts[0];
23
+ const decimalPart = parts[1] || "";
24
+ const n = Math.abs(parseFloat(numStr));
25
+ if (isOrdinal) {
26
+ }
27
+ else {
28
+ if ((n >= 0 && n <= 1) || (n >= 11 && n <= 99))
29
+ return "one";
30
+ }
31
+ return "other";
32
+ }},"locale":"tzm"})
18
33
  }
package/locale-data/ug.js CHANGED
@@ -15,4 +15,19 @@ if (Intl.PluralRules && typeof Intl.PluralRules.__addLocaleData === 'function')
15
15
  }
16
16
  return "other";
17
17
  },"pluralRanges":{"cardinal":{"one_other":"other","other_one":"one","other_other":"other"},"ordinal":{}}},"locale":"ug"})
18
+ } else {
19
+ (globalThis.__FORMATJS_PLURALRULES_DATA__ = globalThis.__FORMATJS_PLURALRULES_DATA__ || []).push({"data":{"categories":{"cardinal":["one","other"],"ordinal":["other"]},"fn":function(num, isOrdinal, exponent = 0) {
20
+ const numStr = String(num);
21
+ const parts = numStr.split(".");
22
+ const integerPart = parts[0];
23
+ const decimalPart = parts[1] || "";
24
+ const n = Math.abs(parseFloat(numStr));
25
+ if (isOrdinal) {
26
+ }
27
+ else {
28
+ if (n === 1)
29
+ return "one";
30
+ }
31
+ return "other";
32
+ },"pluralRanges":{"cardinal":{"one_other":"other","other_one":"one","other_other":"other"},"ordinal":{}}},"locale":"ug"})
18
33
  }
package/locale-data/uk.js CHANGED
@@ -23,4 +23,27 @@ if (Intl.PluralRules && typeof Intl.PluralRules.__addLocaleData === 'function')
23
23
  }
24
24
  return "other";
25
25
  },"pluralRanges":{"cardinal":{"few_few":"few","few_many":"many","few_one":"one","few_other":"other","many_few":"few","many_many":"many","many_one":"one","many_other":"other","one_few":"few","one_many":"many","one_one":"one","one_other":"other","other_few":"few","other_many":"many","other_one":"one","other_other":"other"},"ordinal":{}}},"locale":"uk"})
26
+ } else {
27
+ (globalThis.__FORMATJS_PLURALRULES_DATA__ = globalThis.__FORMATJS_PLURALRULES_DATA__ || []).push({"data":{"categories":{"cardinal":["few","many","one","other"],"ordinal":["few","other"]},"fn":function(num, isOrdinal, exponent = 0) {
28
+ const numStr = String(num);
29
+ const parts = numStr.split(".");
30
+ const integerPart = parts[0];
31
+ const decimalPart = parts[1] || "";
32
+ const n = Math.abs(parseFloat(numStr));
33
+ const i = Math.floor(Math.abs(parseFloat(integerPart)));
34
+ const v = decimalPart.length;
35
+ if (isOrdinal) {
36
+ if ((n % 10) === 3 && (n % 100) !== 13)
37
+ return "few";
38
+ }
39
+ else {
40
+ if (v === 0 && ((i % 10) >= 2 && (i % 10) <= 4) && ((i % 100) < 12 || (i % 100) > 14))
41
+ return "few";
42
+ if (v === 0 && (i % 10) === 0 || v === 0 && ((i % 10) >= 5 && (i % 10) <= 9) || v === 0 && ((i % 100) >= 11 && (i % 100) <= 14))
43
+ return "many";
44
+ if (v === 0 && (i % 10) === 1 && (i % 100) !== 11)
45
+ return "one";
46
+ }
47
+ return "other";
48
+ },"pluralRanges":{"cardinal":{"few_few":"few","few_many":"many","few_one":"one","few_other":"other","many_few":"few","many_many":"many","many_one":"one","many_other":"other","one_few":"few","one_many":"many","one_one":"one","one_other":"other","other_few":"few","other_many":"many","other_one":"one","other_other":"other"},"ordinal":{}}},"locale":"uk"})
26
49
  }
@@ -4,4 +4,8 @@ if (Intl.PluralRules && typeof Intl.PluralRules.__addLocaleData === 'function')
4
4
  Intl.PluralRules.__addLocaleData({"data":{"categories":{"cardinal":["other"],"ordinal":["other"]},"fn":function(num, isOrdinal, exponent = 0) {
5
5
  return "other";
6
6
  }},"locale":"und"})
7
+ } else {
8
+ (globalThis.__FORMATJS_PLURALRULES_DATA__ = globalThis.__FORMATJS_PLURALRULES_DATA__ || []).push({"data":{"categories":{"cardinal":["other"],"ordinal":["other"]},"fn":function(num, isOrdinal, exponent = 0) {
9
+ return "other";
10
+ }},"locale":"und"})
7
11
  }
package/locale-data/ur.js CHANGED
@@ -16,4 +16,20 @@ if (Intl.PluralRules && typeof Intl.PluralRules.__addLocaleData === 'function')
16
16
  }
17
17
  return "other";
18
18
  },"pluralRanges":{"cardinal":{"one_other":"other","other_one":"other","other_other":"other"},"ordinal":{}}},"locale":"ur"})
19
+ } else {
20
+ (globalThis.__FORMATJS_PLURALRULES_DATA__ = globalThis.__FORMATJS_PLURALRULES_DATA__ || []).push({"data":{"categories":{"cardinal":["one","other"],"ordinal":["other"]},"fn":function(num, isOrdinal, exponent = 0) {
21
+ const numStr = String(num);
22
+ const parts = numStr.split(".");
23
+ const integerPart = parts[0];
24
+ const decimalPart = parts[1] || "";
25
+ const i = Math.floor(Math.abs(parseFloat(integerPart)));
26
+ const v = decimalPart.length;
27
+ if (isOrdinal) {
28
+ }
29
+ else {
30
+ if (i === 1 && v === 0)
31
+ return "one";
32
+ }
33
+ return "other";
34
+ },"pluralRanges":{"cardinal":{"one_other":"other","other_one":"other","other_other":"other"},"ordinal":{}}},"locale":"ur"})
19
35
  }
package/locale-data/uz.js CHANGED
@@ -15,4 +15,19 @@ if (Intl.PluralRules && typeof Intl.PluralRules.__addLocaleData === 'function')
15
15
  }
16
16
  return "other";
17
17
  },"pluralRanges":{"cardinal":{"one_other":"other","other_one":"one","other_other":"other"},"ordinal":{}}},"locale":"uz"})
18
+ } else {
19
+ (globalThis.__FORMATJS_PLURALRULES_DATA__ = globalThis.__FORMATJS_PLURALRULES_DATA__ || []).push({"data":{"categories":{"cardinal":["one","other"],"ordinal":["other"]},"fn":function(num, isOrdinal, exponent = 0) {
20
+ const numStr = String(num);
21
+ const parts = numStr.split(".");
22
+ const integerPart = parts[0];
23
+ const decimalPart = parts[1] || "";
24
+ const n = Math.abs(parseFloat(numStr));
25
+ if (isOrdinal) {
26
+ }
27
+ else {
28
+ if (n === 1)
29
+ return "one";
30
+ }
31
+ return "other";
32
+ },"pluralRanges":{"cardinal":{"one_other":"other","other_one":"one","other_other":"other"},"ordinal":{}}},"locale":"uz"})
18
33
  }
package/locale-data/ve.js CHANGED
@@ -15,4 +15,19 @@ if (Intl.PluralRules && typeof Intl.PluralRules.__addLocaleData === 'function')
15
15
  }
16
16
  return "other";
17
17
  }},"locale":"ve"})
18
+ } else {
19
+ (globalThis.__FORMATJS_PLURALRULES_DATA__ = globalThis.__FORMATJS_PLURALRULES_DATA__ || []).push({"data":{"categories":{"cardinal":["one","other"],"ordinal":["other"]},"fn":function(num, isOrdinal, exponent = 0) {
20
+ const numStr = String(num);
21
+ const parts = numStr.split(".");
22
+ const integerPart = parts[0];
23
+ const decimalPart = parts[1] || "";
24
+ const n = Math.abs(parseFloat(numStr));
25
+ if (isOrdinal) {
26
+ }
27
+ else {
28
+ if (n === 1)
29
+ return "one";
30
+ }
31
+ return "other";
32
+ }},"locale":"ve"})
18
33
  }
package/locale-data/vi.js CHANGED
@@ -15,4 +15,19 @@ if (Intl.PluralRules && typeof Intl.PluralRules.__addLocaleData === 'function')
15
15
  }
16
16
  return "other";
17
17
  },"pluralRanges":{"cardinal":{"other_other":"other"},"ordinal":{}}},"locale":"vi"})
18
+ } else {
19
+ (globalThis.__FORMATJS_PLURALRULES_DATA__ = globalThis.__FORMATJS_PLURALRULES_DATA__ || []).push({"data":{"categories":{"cardinal":["other"],"ordinal":["one","other"]},"fn":function(num, isOrdinal, exponent = 0) {
20
+ const numStr = String(num);
21
+ const parts = numStr.split(".");
22
+ const integerPart = parts[0];
23
+ const decimalPart = parts[1] || "";
24
+ const n = Math.abs(parseFloat(numStr));
25
+ if (isOrdinal) {
26
+ if (n === 1)
27
+ return "one";
28
+ }
29
+ else {
30
+ }
31
+ return "other";
32
+ },"pluralRanges":{"cardinal":{"other_other":"other"},"ordinal":{}}},"locale":"vi"})
18
33
  }
package/locale-data/vo.js CHANGED
@@ -15,4 +15,19 @@ if (Intl.PluralRules && typeof Intl.PluralRules.__addLocaleData === 'function')
15
15
  }
16
16
  return "other";
17
17
  }},"locale":"vo"})
18
+ } else {
19
+ (globalThis.__FORMATJS_PLURALRULES_DATA__ = globalThis.__FORMATJS_PLURALRULES_DATA__ || []).push({"data":{"categories":{"cardinal":["one","other"],"ordinal":["other"]},"fn":function(num, isOrdinal, exponent = 0) {
20
+ const numStr = String(num);
21
+ const parts = numStr.split(".");
22
+ const integerPart = parts[0];
23
+ const decimalPart = parts[1] || "";
24
+ const n = Math.abs(parseFloat(numStr));
25
+ if (isOrdinal) {
26
+ }
27
+ else {
28
+ if (n === 1)
29
+ return "one";
30
+ }
31
+ return "other";
32
+ }},"locale":"vo"})
18
33
  }
@@ -15,4 +15,19 @@ if (Intl.PluralRules && typeof Intl.PluralRules.__addLocaleData === 'function')
15
15
  }
16
16
  return "other";
17
17
  }},"locale":"vun"})
18
+ } else {
19
+ (globalThis.__FORMATJS_PLURALRULES_DATA__ = globalThis.__FORMATJS_PLURALRULES_DATA__ || []).push({"data":{"categories":{"cardinal":["one","other"],"ordinal":["other"]},"fn":function(num, isOrdinal, exponent = 0) {
20
+ const numStr = String(num);
21
+ const parts = numStr.split(".");
22
+ const integerPart = parts[0];
23
+ const decimalPart = parts[1] || "";
24
+ const n = Math.abs(parseFloat(numStr));
25
+ if (isOrdinal) {
26
+ }
27
+ else {
28
+ if (n === 1)
29
+ return "one";
30
+ }
31
+ return "other";
32
+ }},"locale":"vun"})
18
33
  }
package/locale-data/wa.js CHANGED
@@ -15,4 +15,19 @@ if (Intl.PluralRules && typeof Intl.PluralRules.__addLocaleData === 'function')
15
15
  }
16
16
  return "other";
17
17
  }},"locale":"wa"})
18
+ } else {
19
+ (globalThis.__FORMATJS_PLURALRULES_DATA__ = globalThis.__FORMATJS_PLURALRULES_DATA__ || []).push({"data":{"categories":{"cardinal":["one","other"],"ordinal":["other"]},"fn":function(num, isOrdinal, exponent = 0) {
20
+ const numStr = String(num);
21
+ const parts = numStr.split(".");
22
+ const integerPart = parts[0];
23
+ const decimalPart = parts[1] || "";
24
+ const n = Math.abs(parseFloat(numStr));
25
+ if (isOrdinal) {
26
+ }
27
+ else {
28
+ if ((n >= 0 && n <= 1))
29
+ return "one";
30
+ }
31
+ return "other";
32
+ }},"locale":"wa"})
18
33
  }
@@ -15,4 +15,19 @@ if (Intl.PluralRules && typeof Intl.PluralRules.__addLocaleData === 'function')
15
15
  }
16
16
  return "other";
17
17
  }},"locale":"wae"})
18
+ } else {
19
+ (globalThis.__FORMATJS_PLURALRULES_DATA__ = globalThis.__FORMATJS_PLURALRULES_DATA__ || []).push({"data":{"categories":{"cardinal":["one","other"],"ordinal":["other"]},"fn":function(num, isOrdinal, exponent = 0) {
20
+ const numStr = String(num);
21
+ const parts = numStr.split(".");
22
+ const integerPart = parts[0];
23
+ const decimalPart = parts[1] || "";
24
+ const n = Math.abs(parseFloat(numStr));
25
+ if (isOrdinal) {
26
+ }
27
+ else {
28
+ if (n === 1)
29
+ return "one";
30
+ }
31
+ return "other";
32
+ }},"locale":"wae"})
18
33
  }
package/locale-data/wo.js CHANGED
@@ -4,4 +4,8 @@ if (Intl.PluralRules && typeof Intl.PluralRules.__addLocaleData === 'function')
4
4
  Intl.PluralRules.__addLocaleData({"data":{"categories":{"cardinal":["other"],"ordinal":["other"]},"fn":function(num, isOrdinal, exponent = 0) {
5
5
  return "other";
6
6
  }},"locale":"wo"})
7
+ } else {
8
+ (globalThis.__FORMATJS_PLURALRULES_DATA__ = globalThis.__FORMATJS_PLURALRULES_DATA__ || []).push({"data":{"categories":{"cardinal":["other"],"ordinal":["other"]},"fn":function(num, isOrdinal, exponent = 0) {
9
+ return "other";
10
+ }},"locale":"wo"})
7
11
  }
package/locale-data/xh.js CHANGED
@@ -15,4 +15,19 @@ if (Intl.PluralRules && typeof Intl.PluralRules.__addLocaleData === 'function')
15
15
  }
16
16
  return "other";
17
17
  }},"locale":"xh"})
18
+ } else {
19
+ (globalThis.__FORMATJS_PLURALRULES_DATA__ = globalThis.__FORMATJS_PLURALRULES_DATA__ || []).push({"data":{"categories":{"cardinal":["one","other"],"ordinal":["other"]},"fn":function(num, isOrdinal, exponent = 0) {
20
+ const numStr = String(num);
21
+ const parts = numStr.split(".");
22
+ const integerPart = parts[0];
23
+ const decimalPart = parts[1] || "";
24
+ const n = Math.abs(parseFloat(numStr));
25
+ if (isOrdinal) {
26
+ }
27
+ else {
28
+ if (n === 1)
29
+ return "one";
30
+ }
31
+ return "other";
32
+ }},"locale":"xh"})
18
33
  }
@@ -15,4 +15,19 @@ if (Intl.PluralRules && typeof Intl.PluralRules.__addLocaleData === 'function')
15
15
  }
16
16
  return "other";
17
17
  }},"locale":"xog"})
18
+ } else {
19
+ (globalThis.__FORMATJS_PLURALRULES_DATA__ = globalThis.__FORMATJS_PLURALRULES_DATA__ || []).push({"data":{"categories":{"cardinal":["one","other"],"ordinal":["other"]},"fn":function(num, isOrdinal, exponent = 0) {
20
+ const numStr = String(num);
21
+ const parts = numStr.split(".");
22
+ const integerPart = parts[0];
23
+ const decimalPart = parts[1] || "";
24
+ const n = Math.abs(parseFloat(numStr));
25
+ if (isOrdinal) {
26
+ }
27
+ else {
28
+ if (n === 1)
29
+ return "one";
30
+ }
31
+ return "other";
32
+ }},"locale":"xog"})
18
33
  }
package/locale-data/yi.js CHANGED
@@ -16,4 +16,20 @@ if (Intl.PluralRules && typeof Intl.PluralRules.__addLocaleData === 'function')
16
16
  }
17
17
  return "other";
18
18
  }},"locale":"yi"})
19
+ } else {
20
+ (globalThis.__FORMATJS_PLURALRULES_DATA__ = globalThis.__FORMATJS_PLURALRULES_DATA__ || []).push({"data":{"categories":{"cardinal":["one","other"],"ordinal":["other"]},"fn":function(num, isOrdinal, exponent = 0) {
21
+ const numStr = String(num);
22
+ const parts = numStr.split(".");
23
+ const integerPart = parts[0];
24
+ const decimalPart = parts[1] || "";
25
+ const i = Math.floor(Math.abs(parseFloat(integerPart)));
26
+ const v = decimalPart.length;
27
+ if (isOrdinal) {
28
+ }
29
+ else {
30
+ if (i === 1 && v === 0)
31
+ return "one";
32
+ }
33
+ return "other";
34
+ }},"locale":"yi"})
19
35
  }
package/locale-data/yo.js CHANGED
@@ -4,4 +4,8 @@ if (Intl.PluralRules && typeof Intl.PluralRules.__addLocaleData === 'function')
4
4
  Intl.PluralRules.__addLocaleData({"data":{"categories":{"cardinal":["other"],"ordinal":["other"]},"fn":function(num, isOrdinal, exponent = 0) {
5
5
  return "other";
6
6
  }},"locale":"yo"})
7
+ } else {
8
+ (globalThis.__FORMATJS_PLURALRULES_DATA__ = globalThis.__FORMATJS_PLURALRULES_DATA__ || []).push({"data":{"categories":{"cardinal":["other"],"ordinal":["other"]},"fn":function(num, isOrdinal, exponent = 0) {
9
+ return "other";
10
+ }},"locale":"yo"})
7
11
  }
@@ -4,4 +4,8 @@ if (Intl.PluralRules && typeof Intl.PluralRules.__addLocaleData === 'function')
4
4
  Intl.PluralRules.__addLocaleData({"data":{"categories":{"cardinal":["other"],"ordinal":["other"]},"fn":function(num, isOrdinal, exponent = 0) {
5
5
  return "other";
6
6
  },"pluralRanges":{"cardinal":{"other_other":"other"},"ordinal":{}}},"locale":"yue"})
7
+ } else {
8
+ (globalThis.__FORMATJS_PLURALRULES_DATA__ = globalThis.__FORMATJS_PLURALRULES_DATA__ || []).push({"data":{"categories":{"cardinal":["other"],"ordinal":["other"]},"fn":function(num, isOrdinal, exponent = 0) {
9
+ return "other";
10
+ },"pluralRanges":{"cardinal":{"other_other":"other"},"ordinal":{}}},"locale":"yue"})
7
11
  }
package/locale-data/zh.js CHANGED
@@ -4,4 +4,8 @@ if (Intl.PluralRules && typeof Intl.PluralRules.__addLocaleData === 'function')
4
4
  Intl.PluralRules.__addLocaleData({"data":{"categories":{"cardinal":["other"],"ordinal":["other"]},"fn":function(num, isOrdinal, exponent = 0) {
5
5
  return "other";
6
6
  },"pluralRanges":{"cardinal":{"other_other":"other"},"ordinal":{}}},"locale":"zh"})
7
+ } else {
8
+ (globalThis.__FORMATJS_PLURALRULES_DATA__ = globalThis.__FORMATJS_PLURALRULES_DATA__ || []).push({"data":{"categories":{"cardinal":["other"],"ordinal":["other"]},"fn":function(num, isOrdinal, exponent = 0) {
9
+ return "other";
10
+ },"pluralRanges":{"cardinal":{"other_other":"other"},"ordinal":{}}},"locale":"zh"})
7
11
  }
package/locale-data/zu.js CHANGED
@@ -16,4 +16,20 @@ if (Intl.PluralRules && typeof Intl.PluralRules.__addLocaleData === 'function')
16
16
  }
17
17
  return "other";
18
18
  },"pluralRanges":{"cardinal":{"one_one":"one","one_other":"other","other_other":"other"},"ordinal":{}}},"locale":"zu"})
19
+ } else {
20
+ (globalThis.__FORMATJS_PLURALRULES_DATA__ = globalThis.__FORMATJS_PLURALRULES_DATA__ || []).push({"data":{"categories":{"cardinal":["one","other"],"ordinal":["other"]},"fn":function(num, isOrdinal, exponent = 0) {
21
+ const numStr = String(num);
22
+ const parts = numStr.split(".");
23
+ const integerPart = parts[0];
24
+ const decimalPart = parts[1] || "";
25
+ const n = Math.abs(parseFloat(numStr));
26
+ const i = Math.floor(Math.abs(parseFloat(integerPart)));
27
+ if (isOrdinal) {
28
+ }
29
+ else {
30
+ if (i === 0 || n === 1)
31
+ return "one";
32
+ }
33
+ return "other";
34
+ },"pluralRanges":{"cardinal":{"one_one":"one","one_other":"other","other_other":"other"},"ordinal":{}}},"locale":"zu"})
19
35
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@formatjs/intl-pluralrules",
3
3
  "description": "Polyfill for Intl.PluralRules",
4
- "version": "6.2.4",
4
+ "version": "6.3.2",
5
5
  "license": "MIT",
6
6
  "author": "Long Ho <holevietlong@gmail.com>",
7
7
  "type": "module",
@@ -15,13 +15,12 @@
15
15
  "./locale-data": "./locale-data"
16
16
  },
17
17
  "dependencies": {
18
- "decimal.js": "^10.6.0",
19
- "@formatjs/intl-localematcher": "0.8.2",
20
- "@formatjs/ecma402-abstract": "3.1.2"
18
+ "@formatjs/bigdecimal": "0.2.1",
19
+ "@formatjs/intl-localematcher": "0.8.3"
21
20
  },
22
21
  "devDependencies": {
23
- "@formatjs/intl-locale": "5.2.2",
24
- "@formatjs/intl-getcanonicallocales": "3.2.2"
22
+ "@formatjs/intl-getcanonicallocales": "3.2.3",
23
+ "@formatjs/intl-locale": "5.3.2"
25
24
  },
26
25
  "bugs": "https://github.com/formatjs/formatjs/issues",
27
26
  "gitHead": "a7842673d8ad205171ad7c8cb8bb2f318b427c0c",
@@ -1 +1 @@
1
- export {};
1
+ export { };