@formatjs/intl-pluralrules 6.3.15 → 6.4.0
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.
- package/LICENSE.md +0 -0
- package/README.md +0 -0
- package/index.d.ts +13 -1
- package/index.js +14 -63
- package/index.js.map +1 -1
- package/locale-data/af.d.ts +0 -0
- package/locale-data/af.js +2 -2
- package/locale-data/ak.d.ts +0 -0
- package/locale-data/ak.js +2 -2
- package/locale-data/am.d.ts +0 -0
- package/locale-data/am.js +2 -2
- package/locale-data/an.d.ts +0 -0
- package/locale-data/an.js +2 -2
- package/locale-data/ar.d.ts +0 -0
- package/locale-data/ar.js +32 -16
- package/locale-data/ars.d.ts +0 -0
- package/locale-data/ars.js +32 -16
- package/locale-data/as.d.ts +0 -0
- package/locale-data/as.js +14 -14
- package/locale-data/asa.d.ts +0 -0
- package/locale-data/asa.js +2 -2
- package/locale-data/ast.d.ts +0 -0
- package/locale-data/ast.js +0 -0
- package/locale-data/az.d.ts +0 -0
- package/locale-data/az.js +26 -10
- package/locale-data/bal.d.ts +0 -0
- package/locale-data/bal.js +4 -4
- package/locale-data/be.d.ts +0 -0
- package/locale-data/be.js +26 -10
- package/locale-data/bem.d.ts +0 -0
- package/locale-data/bem.js +2 -2
- package/locale-data/bez.d.ts +0 -0
- package/locale-data/bez.js +2 -2
- package/locale-data/bg.d.ts +0 -0
- package/locale-data/bg.js +2 -2
- package/locale-data/bho.d.ts +0 -0
- package/locale-data/bho.js +2 -2
- package/locale-data/blo.d.ts +0 -0
- package/locale-data/blo.js +14 -14
- package/locale-data/bm.d.ts +0 -0
- package/locale-data/bm.js +0 -0
- package/locale-data/bn.d.ts +0 -0
- package/locale-data/bn.js +14 -14
- package/locale-data/bo.d.ts +0 -0
- package/locale-data/bo.js +0 -0
- package/locale-data/br.d.ts +0 -0
- package/locale-data/br.js +28 -12
- package/locale-data/brx.d.ts +0 -0
- package/locale-data/brx.js +2 -2
- package/locale-data/bs.d.ts +0 -0
- package/locale-data/bs.js +22 -6
- package/locale-data/ca.d.ts +0 -0
- package/locale-data/ca.js +28 -12
- package/locale-data/ce.d.ts +0 -0
- package/locale-data/ce.js +2 -2
- package/locale-data/ceb.d.ts +0 -0
- package/locale-data/ceb.js +18 -2
- package/locale-data/cgg.d.ts +0 -0
- package/locale-data/cgg.js +2 -2
- package/locale-data/chr.d.ts +0 -0
- package/locale-data/chr.js +2 -2
- package/locale-data/ckb.d.ts +0 -0
- package/locale-data/ckb.js +2 -2
- package/locale-data/cs.d.ts +0 -0
- package/locale-data/cs.js +4 -4
- package/locale-data/csw.d.ts +0 -0
- package/locale-data/csw.js +2 -2
- package/locale-data/cv.d.ts +0 -0
- package/locale-data/cv.js +6 -6
- package/locale-data/cy.d.ts +0 -0
- package/locale-data/cy.js +32 -32
- package/locale-data/da.d.ts +0 -0
- package/locale-data/da.js +2 -2
- package/locale-data/de.d.ts +0 -0
- package/locale-data/de.js +0 -0
- package/locale-data/doi.d.ts +0 -0
- package/locale-data/doi.js +2 -2
- package/locale-data/dsb.d.ts +0 -0
- package/locale-data/dsb.js +24 -8
- package/locale-data/dv.d.ts +0 -0
- package/locale-data/dv.js +2 -2
- package/locale-data/dz.d.ts +0 -0
- package/locale-data/dz.js +0 -0
- package/locale-data/ee.d.ts +0 -0
- package/locale-data/ee.js +2 -2
- package/locale-data/el.d.ts +0 -0
- package/locale-data/el.js +2 -2
- package/locale-data/en.d.ts +0 -0
- package/locale-data/en.js +24 -8
- package/locale-data/eo.d.ts +0 -0
- package/locale-data/eo.js +2 -2
- package/locale-data/es.d.ts +0 -0
- package/locale-data/es.js +22 -6
- package/locale-data/et.d.ts +0 -0
- package/locale-data/et.js +0 -0
- package/locale-data/eu.d.ts +0 -0
- package/locale-data/eu.js +2 -2
- package/locale-data/fa.d.ts +0 -0
- package/locale-data/fa.js +2 -2
- package/locale-data/ff.d.ts +0 -0
- package/locale-data/ff.js +0 -0
- package/locale-data/fi.d.ts +0 -0
- package/locale-data/fi.js +0 -0
- package/locale-data/fil.d.ts +0 -0
- package/locale-data/fil.js +20 -4
- package/locale-data/fo.d.ts +0 -0
- package/locale-data/fo.js +2 -2
- package/locale-data/fr.d.ts +0 -0
- package/locale-data/fr.js +22 -6
- package/locale-data/fur.d.ts +0 -0
- package/locale-data/fur.js +2 -2
- package/locale-data/fy.d.ts +0 -0
- package/locale-data/fy.js +0 -0
- package/locale-data/ga.d.ts +0 -0
- package/locale-data/ga.js +14 -14
- package/locale-data/gd.d.ts +0 -0
- package/locale-data/gd.js +16 -16
- package/locale-data/gl.d.ts +0 -0
- package/locale-data/gl.js +0 -0
- package/locale-data/gsw.d.ts +0 -0
- package/locale-data/gsw.js +2 -2
- package/locale-data/gu.d.ts +0 -0
- package/locale-data/gu.js +14 -14
- package/locale-data/guw.d.ts +0 -0
- package/locale-data/guw.js +2 -2
- package/locale-data/gv.d.ts +0 -0
- package/locale-data/gv.js +26 -10
- package/locale-data/ha.d.ts +0 -0
- package/locale-data/ha.js +2 -2
- package/locale-data/haw.d.ts +0 -0
- package/locale-data/haw.js +2 -2
- package/locale-data/he.d.ts +0 -0
- package/locale-data/he.js +0 -0
- package/locale-data/hi.d.ts +0 -0
- package/locale-data/hi.js +14 -14
- package/locale-data/hnj.d.ts +0 -0
- package/locale-data/hnj.js +0 -0
- package/locale-data/hr.d.ts +0 -0
- package/locale-data/hr.js +22 -6
- package/locale-data/hsb.d.ts +0 -0
- package/locale-data/hsb.js +24 -8
- package/locale-data/hu.d.ts +0 -0
- package/locale-data/hu.js +4 -4
- package/locale-data/hy.d.ts +0 -0
- package/locale-data/hy.js +2 -2
- package/locale-data/ia.d.ts +0 -0
- package/locale-data/ia.js +0 -0
- package/locale-data/id.d.ts +0 -0
- package/locale-data/id.js +0 -0
- package/locale-data/ie.d.ts +0 -0
- package/locale-data/ie.js +0 -0
- package/locale-data/ig.d.ts +0 -0
- package/locale-data/ig.js +0 -0
- package/locale-data/ii.d.ts +0 -0
- package/locale-data/ii.js +0 -0
- package/locale-data/io.d.ts +0 -0
- package/locale-data/io.js +0 -0
- package/locale-data/is.d.ts +0 -0
- package/locale-data/is.js +18 -2
- package/locale-data/it.d.ts +0 -0
- package/locale-data/it.js +22 -6
- package/locale-data/iu.d.ts +0 -0
- package/locale-data/iu.js +4 -4
- package/locale-data/ja.d.ts +0 -0
- package/locale-data/ja.js +0 -0
- package/locale-data/jbo.d.ts +0 -0
- package/locale-data/jbo.js +0 -0
- package/locale-data/jgo.d.ts +0 -0
- package/locale-data/jgo.js +2 -2
- package/locale-data/jmc.d.ts +0 -0
- package/locale-data/jmc.js +2 -2
- package/locale-data/jv.d.ts +0 -0
- package/locale-data/jv.js +0 -0
- package/locale-data/jw.d.ts +0 -0
- package/locale-data/jw.js +0 -0
- package/locale-data/ka.d.ts +0 -0
- package/locale-data/ka.js +22 -6
- package/locale-data/kab.d.ts +0 -0
- package/locale-data/kab.js +0 -0
- package/locale-data/kaj.d.ts +0 -0
- package/locale-data/kaj.js +2 -2
- package/locale-data/kcg.d.ts +0 -0
- package/locale-data/kcg.js +2 -2
- package/locale-data/kde.d.ts +0 -0
- package/locale-data/kde.js +0 -0
- package/locale-data/kea.d.ts +0 -0
- package/locale-data/kea.js +0 -0
- package/locale-data/kk.d.ts +0 -0
- package/locale-data/kk.js +20 -4
- package/locale-data/kkj.d.ts +0 -0
- package/locale-data/kkj.js +2 -2
- package/locale-data/kl.d.ts +0 -0
- package/locale-data/kl.js +2 -2
- package/locale-data/km.d.ts +0 -0
- package/locale-data/km.js +0 -0
- package/locale-data/kn.d.ts +0 -0
- package/locale-data/kn.js +2 -2
- package/locale-data/ko.d.ts +0 -0
- package/locale-data/ko.js +0 -0
- package/locale-data/kok-Latn.d.ts +0 -0
- package/locale-data/kok-Latn.js +10 -10
- package/locale-data/kok.d.ts +0 -0
- package/locale-data/kok.js +10 -10
- package/locale-data/ks.d.ts +0 -0
- package/locale-data/ks.js +2 -2
- package/locale-data/ksb.d.ts +0 -0
- package/locale-data/ksb.js +2 -2
- package/locale-data/ksh.d.ts +0 -0
- package/locale-data/ksh.js +6 -6
- package/locale-data/ku.d.ts +0 -0
- package/locale-data/ku.js +2 -2
- package/locale-data/kw.d.ts +0 -0
- package/locale-data/kw.js +38 -22
- package/locale-data/ky.d.ts +0 -0
- package/locale-data/ky.js +2 -2
- package/locale-data/lag.d.ts +0 -0
- package/locale-data/lag.js +6 -6
- package/locale-data/lb.d.ts +0 -0
- package/locale-data/lb.js +2 -2
- package/locale-data/lg.d.ts +0 -0
- package/locale-data/lg.js +2 -2
- package/locale-data/lij.d.ts +0 -0
- package/locale-data/lij.js +2 -2
- package/locale-data/lkt.d.ts +0 -0
- package/locale-data/lkt.js +0 -0
- package/locale-data/lld.d.ts +0 -0
- package/locale-data/lld.js +22 -6
- package/locale-data/ln.d.ts +0 -0
- package/locale-data/ln.js +2 -2
- package/locale-data/lo.d.ts +0 -0
- package/locale-data/lo.js +2 -2
- package/locale-data/lt.d.ts +0 -0
- package/locale-data/lt.js +22 -6
- package/locale-data/lv.d.ts +0 -0
- package/locale-data/lv.js +22 -6
- package/locale-data/mas.d.ts +0 -0
- package/locale-data/mas.js +2 -2
- package/locale-data/mg.d.ts +0 -0
- package/locale-data/mg.js +2 -2
- package/locale-data/mgo.d.ts +0 -0
- package/locale-data/mgo.js +2 -2
- package/locale-data/mk.d.ts +0 -0
- package/locale-data/mk.js +26 -10
- package/locale-data/ml.d.ts +0 -0
- package/locale-data/ml.js +2 -2
- package/locale-data/mn.d.ts +0 -0
- package/locale-data/mn.js +2 -2
- package/locale-data/mo.d.ts +0 -0
- package/locale-data/mo.js +22 -6
- package/locale-data/mr.d.ts +0 -0
- package/locale-data/mr.js +10 -10
- package/locale-data/ms.d.ts +0 -0
- package/locale-data/ms.js +2 -2
- package/locale-data/mt.d.ts +0 -0
- package/locale-data/mt.js +28 -12
- package/locale-data/my.d.ts +0 -0
- package/locale-data/my.js +0 -0
- package/locale-data/nah.d.ts +0 -0
- package/locale-data/nah.js +2 -2
- package/locale-data/naq.d.ts +0 -0
- package/locale-data/naq.js +4 -4
- package/locale-data/nb.d.ts +0 -0
- package/locale-data/nb.js +2 -2
- package/locale-data/nd.d.ts +0 -0
- package/locale-data/nd.js +2 -2
- package/locale-data/ne.d.ts +0 -0
- package/locale-data/ne.js +4 -4
- package/locale-data/nl.d.ts +0 -0
- package/locale-data/nl.js +0 -0
- package/locale-data/nn.d.ts +0 -0
- package/locale-data/nn.js +2 -2
- package/locale-data/nnh.d.ts +0 -0
- package/locale-data/nnh.js +2 -2
- package/locale-data/no.d.ts +0 -0
- package/locale-data/no.js +2 -2
- package/locale-data/nqo.d.ts +0 -0
- package/locale-data/nqo.js +0 -0
- package/locale-data/nr.d.ts +0 -0
- package/locale-data/nr.js +2 -2
- package/locale-data/nso.d.ts +0 -0
- package/locale-data/nso.js +2 -2
- package/locale-data/ny.d.ts +0 -0
- package/locale-data/ny.js +2 -2
- package/locale-data/nyn.d.ts +0 -0
- package/locale-data/nyn.js +2 -2
- package/locale-data/om.d.ts +0 -0
- package/locale-data/om.js +2 -2
- package/locale-data/or.d.ts +0 -0
- package/locale-data/or.js +14 -14
- package/locale-data/os.d.ts +0 -0
- package/locale-data/os.js +2 -2
- package/locale-data/osa.d.ts +0 -0
- package/locale-data/osa.js +0 -0
- package/locale-data/pa.d.ts +0 -0
- package/locale-data/pa.js +2 -2
- package/locale-data/pap.d.ts +0 -0
- package/locale-data/pap.js +2 -2
- package/locale-data/pcm.d.ts +0 -0
- package/locale-data/pcm.js +2 -2
- package/locale-data/pl.d.ts +0 -0
- package/locale-data/pl.js +24 -8
- package/locale-data/prg.d.ts +0 -0
- package/locale-data/prg.js +22 -6
- package/locale-data/ps.d.ts +0 -0
- package/locale-data/ps.js +2 -2
- package/locale-data/pt-PT.d.ts +0 -0
- package/locale-data/pt-PT.js +20 -4
- package/locale-data/pt.d.ts +0 -0
- package/locale-data/pt.js +20 -4
- package/locale-data/rm.d.ts +0 -0
- package/locale-data/rm.js +2 -2
- package/locale-data/ro.d.ts +0 -0
- package/locale-data/ro.js +22 -6
- package/locale-data/rof.d.ts +0 -0
- package/locale-data/rof.js +2 -2
- package/locale-data/ru.d.ts +0 -0
- package/locale-data/ru.js +24 -8
- package/locale-data/rwk.d.ts +0 -0
- package/locale-data/rwk.js +2 -2
- package/locale-data/sah.d.ts +0 -0
- package/locale-data/sah.js +0 -0
- package/locale-data/saq.d.ts +0 -0
- package/locale-data/saq.js +2 -2
- package/locale-data/sat.d.ts +0 -0
- package/locale-data/sat.js +4 -4
- package/locale-data/sc.d.ts +0 -0
- package/locale-data/sc.js +2 -2
- package/locale-data/scn.d.ts +0 -0
- package/locale-data/scn.js +22 -6
- package/locale-data/sd.d.ts +0 -0
- package/locale-data/sd.js +2 -2
- package/locale-data/sdh.d.ts +0 -0
- package/locale-data/sdh.js +2 -2
- package/locale-data/se.d.ts +0 -0
- package/locale-data/se.js +4 -4
- package/locale-data/seh.d.ts +0 -0
- package/locale-data/seh.js +2 -2
- package/locale-data/ses.d.ts +0 -0
- package/locale-data/ses.js +0 -0
- package/locale-data/sg.d.ts +0 -0
- package/locale-data/sg.js +0 -0
- package/locale-data/sgs.d.ts +0 -0
- package/locale-data/sgs.js +26 -10
- package/locale-data/sh.d.ts +0 -0
- package/locale-data/sh.js +22 -6
- package/locale-data/shi.d.ts +0 -0
- package/locale-data/shi.js +6 -6
- package/locale-data/si.d.ts +0 -0
- package/locale-data/si.js +2 -2
- package/locale-data/sk.d.ts +0 -0
- package/locale-data/sk.js +4 -4
- package/locale-data/sl.d.ts +0 -0
- package/locale-data/sl.js +24 -8
- package/locale-data/sma.d.ts +0 -0
- package/locale-data/sma.js +4 -4
- package/locale-data/smi.d.ts +0 -0
- package/locale-data/smi.js +4 -4
- package/locale-data/smj.d.ts +0 -0
- package/locale-data/smj.js +4 -4
- package/locale-data/smn.d.ts +0 -0
- package/locale-data/smn.js +4 -4
- package/locale-data/sms.d.ts +0 -0
- package/locale-data/sms.js +4 -4
- package/locale-data/sn.d.ts +0 -0
- package/locale-data/sn.js +2 -2
- package/locale-data/so.d.ts +0 -0
- package/locale-data/so.js +2 -2
- package/locale-data/sq.d.ts +0 -0
- package/locale-data/sq.js +24 -8
- package/locale-data/sr.d.ts +0 -0
- package/locale-data/sr.js +22 -6
- package/locale-data/ss.d.ts +0 -0
- package/locale-data/ss.js +2 -2
- package/locale-data/ssy.d.ts +0 -0
- package/locale-data/ssy.js +2 -2
- package/locale-data/st.d.ts +0 -0
- package/locale-data/st.js +2 -2
- package/locale-data/su.d.ts +0 -0
- package/locale-data/su.js +0 -0
- package/locale-data/sv.d.ts +0 -0
- package/locale-data/sv.js +18 -2
- package/locale-data/sw.d.ts +0 -0
- package/locale-data/sw.js +0 -0
- package/locale-data/syr.d.ts +0 -0
- package/locale-data/syr.js +2 -2
- package/locale-data/ta.d.ts +0 -0
- package/locale-data/ta.js +2 -2
- package/locale-data/te.d.ts +0 -0
- package/locale-data/te.js +2 -2
- package/locale-data/teo.d.ts +0 -0
- package/locale-data/teo.js +2 -2
- package/locale-data/th.d.ts +0 -0
- package/locale-data/th.js +0 -0
- package/locale-data/ti.d.ts +0 -0
- package/locale-data/ti.js +2 -2
- package/locale-data/tig.d.ts +0 -0
- package/locale-data/tig.js +2 -2
- package/locale-data/tk.d.ts +0 -0
- package/locale-data/tk.js +20 -4
- package/locale-data/tl.d.ts +0 -0
- package/locale-data/tl.js +20 -4
- package/locale-data/tn.d.ts +0 -0
- package/locale-data/tn.js +2 -2
- package/locale-data/to.d.ts +0 -0
- package/locale-data/to.js +0 -0
- package/locale-data/tpi.d.ts +0 -0
- package/locale-data/tpi.js +0 -0
- package/locale-data/tr.d.ts +0 -0
- package/locale-data/tr.js +2 -2
- package/locale-data/ts.d.ts +0 -0
- package/locale-data/ts.js +2 -2
- package/locale-data/tzm.d.ts +0 -0
- package/locale-data/tzm.js +2 -2
- package/locale-data/ug.d.ts +0 -0
- package/locale-data/ug.js +2 -2
- package/locale-data/uk.d.ts +0 -0
- package/locale-data/uk.js +26 -10
- package/locale-data/und.d.ts +0 -0
- package/locale-data/und.js +0 -0
- package/locale-data/ur.d.ts +0 -0
- package/locale-data/ur.js +0 -0
- package/locale-data/uz.d.ts +0 -0
- package/locale-data/uz.js +2 -2
- package/locale-data/ve.d.ts +0 -0
- package/locale-data/ve.js +2 -2
- package/locale-data/vec.d.ts +0 -0
- package/locale-data/vec.js +22 -6
- package/locale-data/vi.d.ts +0 -0
- package/locale-data/vi.js +2 -2
- package/locale-data/vo.d.ts +0 -0
- package/locale-data/vo.js +2 -2
- package/locale-data/vun.d.ts +0 -0
- package/locale-data/vun.js +2 -2
- package/locale-data/wa.d.ts +0 -0
- package/locale-data/wa.js +2 -2
- package/locale-data/wae.d.ts +0 -0
- package/locale-data/wae.js +2 -2
- package/locale-data/wo.d.ts +0 -0
- package/locale-data/wo.js +0 -0
- package/locale-data/xh.d.ts +0 -0
- package/locale-data/xh.js +2 -2
- package/locale-data/xog.d.ts +0 -0
- package/locale-data/xog.js +2 -2
- package/locale-data/yi.d.ts +0 -0
- package/locale-data/yi.js +0 -0
- package/locale-data/yo.d.ts +0 -0
- package/locale-data/yo.js +0 -0
- package/locale-data/yue.d.ts +0 -0
- package/locale-data/yue.js +0 -0
- package/locale-data/zh.d.ts +0 -0
- package/locale-data/zh.js +0 -0
- package/locale-data/zu.d.ts +0 -0
- package/locale-data/zu.js +2 -2
- package/package.json +2 -2
- package/polyfill-force.d.ts +0 -0
- package/polyfill-force.js +14 -63
- package/polyfill-force.js.map +1 -1
- package/polyfill.d.ts +0 -0
- package/polyfill.iife.js +2081 -3496
- package/polyfill.js +14 -63
- package/polyfill.js.map +1 -1
- package/should-polyfill.d.ts +0 -0
- package/should-polyfill.js +0 -0
- package/should-polyfill.js.map +1 -1
package/locale-data/ur.js
CHANGED
|
File without changes
|
package/locale-data/uz.d.ts
CHANGED
|
File without changes
|
package/locale-data/uz.js
CHANGED
|
@@ -10,7 +10,7 @@ if (Intl.PluralRules && typeof Intl.PluralRules.__addLocaleData === 'function')
|
|
|
10
10
|
if (isOrdinal) {
|
|
11
11
|
}
|
|
12
12
|
else {
|
|
13
|
-
if (n === 1)
|
|
13
|
+
if ((!/[1-9]/.test(decimalPart) && n === 1))
|
|
14
14
|
return "one";
|
|
15
15
|
}
|
|
16
16
|
return "other";
|
|
@@ -25,7 +25,7 @@ if (Intl.PluralRules && typeof Intl.PluralRules.__addLocaleData === 'function')
|
|
|
25
25
|
if (isOrdinal) {
|
|
26
26
|
}
|
|
27
27
|
else {
|
|
28
|
-
if (n === 1)
|
|
28
|
+
if ((!/[1-9]/.test(decimalPart) && n === 1))
|
|
29
29
|
return "one";
|
|
30
30
|
}
|
|
31
31
|
return "other";
|
package/locale-data/ve.d.ts
CHANGED
|
File without changes
|
package/locale-data/ve.js
CHANGED
|
@@ -10,7 +10,7 @@ if (Intl.PluralRules && typeof Intl.PluralRules.__addLocaleData === 'function')
|
|
|
10
10
|
if (isOrdinal) {
|
|
11
11
|
}
|
|
12
12
|
else {
|
|
13
|
-
if (n === 1)
|
|
13
|
+
if ((!/[1-9]/.test(decimalPart) && n === 1))
|
|
14
14
|
return "one";
|
|
15
15
|
}
|
|
16
16
|
return "other";
|
|
@@ -25,7 +25,7 @@ if (Intl.PluralRules && typeof Intl.PluralRules.__addLocaleData === 'function')
|
|
|
25
25
|
if (isOrdinal) {
|
|
26
26
|
}
|
|
27
27
|
else {
|
|
28
|
-
if (n === 1)
|
|
28
|
+
if ((!/[1-9]/.test(decimalPart) && n === 1))
|
|
29
29
|
return "one";
|
|
30
30
|
}
|
|
31
31
|
return "other";
|
package/locale-data/vec.d.ts
CHANGED
|
File without changes
|
package/locale-data/vec.js
CHANGED
|
@@ -2,6 +2,14 @@
|
|
|
2
2
|
// prettier-ignore
|
|
3
3
|
if (Intl.PluralRules && typeof Intl.PluralRules.__addLocaleData === 'function') {
|
|
4
4
|
Intl.PluralRules.__addLocaleData({"data":{"categories":{"cardinal":["many","one","other"],"ordinal":["many","other"]},"compactExponents":{"short":{"3":3,"4":3,"5":3,"6":6,"7":6,"8":6,"9":9,"10":9,"11":9,"12":12,"13":12,"14":12},"long":{"3":3,"4":3,"5":3,"6":6,"7":6,"8":6,"9":9,"10":9,"11":9,"12":12,"13":12,"14":12}},"fn":function(num, isOrdinal, exponent = 0) {
|
|
5
|
+
function modDigits(digits, divisor) {
|
|
6
|
+
let value = 0;
|
|
7
|
+
for (let index = 0; index < digits.length; index++) {
|
|
8
|
+
const digit = digits.charCodeAt(index) - 48;
|
|
9
|
+
if (digit >= 0 && digit <= 9) value = (value * 10 + digit) % divisor;
|
|
10
|
+
}
|
|
11
|
+
return value;
|
|
12
|
+
}
|
|
5
13
|
const numStr = String(num);
|
|
6
14
|
const parts = numStr.split(".");
|
|
7
15
|
const integerPart = parts[0];
|
|
@@ -11,19 +19,27 @@ if (Intl.PluralRules && typeof Intl.PluralRules.__addLocaleData === 'function')
|
|
|
11
19
|
const v = decimalPart.length;
|
|
12
20
|
const e = exponent;
|
|
13
21
|
if (isOrdinal) {
|
|
14
|
-
if ((((n === 11 || n === 8) || n === 80) || n === 800))
|
|
22
|
+
if ((!/[1-9]/.test(decimalPart) && (((n === 11 || n === 8) || n === 80) || n === 800)))
|
|
15
23
|
return "many";
|
|
16
24
|
}
|
|
17
25
|
else {
|
|
18
|
-
if (e === 0 && i !== 0 && (i % 1000000) === 0 && v === 0 || (e < 0 || e > 5))
|
|
19
|
-
return "many";
|
|
20
26
|
if (i === 1 && v === 0)
|
|
21
27
|
return "one";
|
|
28
|
+
if (e === 0 && i !== 0 && modDigits(integerPart, 1000000) === 0 && v === 0 || (e < 0 || e > 5))
|
|
29
|
+
return "many";
|
|
22
30
|
}
|
|
23
31
|
return "other";
|
|
24
32
|
}},"locale":"vec"})
|
|
25
33
|
} else {
|
|
26
34
|
(globalThis.__FORMATJS_PLURALRULES_DATA__ = globalThis.__FORMATJS_PLURALRULES_DATA__ || []).push({"data":{"categories":{"cardinal":["many","one","other"],"ordinal":["many","other"]},"compactExponents":{"short":{"3":3,"4":3,"5":3,"6":6,"7":6,"8":6,"9":9,"10":9,"11":9,"12":12,"13":12,"14":12},"long":{"3":3,"4":3,"5":3,"6":6,"7":6,"8":6,"9":9,"10":9,"11":9,"12":12,"13":12,"14":12}},"fn":function(num, isOrdinal, exponent = 0) {
|
|
35
|
+
function modDigits(digits, divisor) {
|
|
36
|
+
let value = 0;
|
|
37
|
+
for (let index = 0; index < digits.length; index++) {
|
|
38
|
+
const digit = digits.charCodeAt(index) - 48;
|
|
39
|
+
if (digit >= 0 && digit <= 9) value = (value * 10 + digit) % divisor;
|
|
40
|
+
}
|
|
41
|
+
return value;
|
|
42
|
+
}
|
|
27
43
|
const numStr = String(num);
|
|
28
44
|
const parts = numStr.split(".");
|
|
29
45
|
const integerPart = parts[0];
|
|
@@ -33,14 +49,14 @@ if (Intl.PluralRules && typeof Intl.PluralRules.__addLocaleData === 'function')
|
|
|
33
49
|
const v = decimalPart.length;
|
|
34
50
|
const e = exponent;
|
|
35
51
|
if (isOrdinal) {
|
|
36
|
-
if ((((n === 11 || n === 8) || n === 80) || n === 800))
|
|
52
|
+
if ((!/[1-9]/.test(decimalPart) && (((n === 11 || n === 8) || n === 80) || n === 800)))
|
|
37
53
|
return "many";
|
|
38
54
|
}
|
|
39
55
|
else {
|
|
40
|
-
if (e === 0 && i !== 0 && (i % 1000000) === 0 && v === 0 || (e < 0 || e > 5))
|
|
41
|
-
return "many";
|
|
42
56
|
if (i === 1 && v === 0)
|
|
43
57
|
return "one";
|
|
58
|
+
if (e === 0 && i !== 0 && modDigits(integerPart, 1000000) === 0 && v === 0 || (e < 0 || e > 5))
|
|
59
|
+
return "many";
|
|
44
60
|
}
|
|
45
61
|
return "other";
|
|
46
62
|
}},"locale":"vec"})
|
package/locale-data/vi.d.ts
CHANGED
|
File without changes
|
package/locale-data/vi.js
CHANGED
|
@@ -8,7 +8,7 @@ if (Intl.PluralRules && typeof Intl.PluralRules.__addLocaleData === 'function')
|
|
|
8
8
|
const decimalPart = parts[1] || "";
|
|
9
9
|
const n = Math.abs(parseFloat(numStr));
|
|
10
10
|
if (isOrdinal) {
|
|
11
|
-
if (n === 1)
|
|
11
|
+
if ((!/[1-9]/.test(decimalPart) && n === 1))
|
|
12
12
|
return "one";
|
|
13
13
|
}
|
|
14
14
|
else {
|
|
@@ -23,7 +23,7 @@ if (Intl.PluralRules && typeof Intl.PluralRules.__addLocaleData === 'function')
|
|
|
23
23
|
const decimalPart = parts[1] || "";
|
|
24
24
|
const n = Math.abs(parseFloat(numStr));
|
|
25
25
|
if (isOrdinal) {
|
|
26
|
-
if (n === 1)
|
|
26
|
+
if ((!/[1-9]/.test(decimalPart) && n === 1))
|
|
27
27
|
return "one";
|
|
28
28
|
}
|
|
29
29
|
else {
|
package/locale-data/vo.d.ts
CHANGED
|
File without changes
|
package/locale-data/vo.js
CHANGED
|
@@ -10,7 +10,7 @@ if (Intl.PluralRules && typeof Intl.PluralRules.__addLocaleData === 'function')
|
|
|
10
10
|
if (isOrdinal) {
|
|
11
11
|
}
|
|
12
12
|
else {
|
|
13
|
-
if (n === 1)
|
|
13
|
+
if ((!/[1-9]/.test(decimalPart) && n === 1))
|
|
14
14
|
return "one";
|
|
15
15
|
}
|
|
16
16
|
return "other";
|
|
@@ -25,7 +25,7 @@ if (Intl.PluralRules && typeof Intl.PluralRules.__addLocaleData === 'function')
|
|
|
25
25
|
if (isOrdinal) {
|
|
26
26
|
}
|
|
27
27
|
else {
|
|
28
|
-
if (n === 1)
|
|
28
|
+
if ((!/[1-9]/.test(decimalPart) && n === 1))
|
|
29
29
|
return "one";
|
|
30
30
|
}
|
|
31
31
|
return "other";
|
package/locale-data/vun.d.ts
CHANGED
|
File without changes
|
package/locale-data/vun.js
CHANGED
|
@@ -10,7 +10,7 @@ if (Intl.PluralRules && typeof Intl.PluralRules.__addLocaleData === 'function')
|
|
|
10
10
|
if (isOrdinal) {
|
|
11
11
|
}
|
|
12
12
|
else {
|
|
13
|
-
if (n === 1)
|
|
13
|
+
if ((!/[1-9]/.test(decimalPart) && n === 1))
|
|
14
14
|
return "one";
|
|
15
15
|
}
|
|
16
16
|
return "other";
|
|
@@ -25,7 +25,7 @@ if (Intl.PluralRules && typeof Intl.PluralRules.__addLocaleData === 'function')
|
|
|
25
25
|
if (isOrdinal) {
|
|
26
26
|
}
|
|
27
27
|
else {
|
|
28
|
-
if (n === 1)
|
|
28
|
+
if ((!/[1-9]/.test(decimalPart) && n === 1))
|
|
29
29
|
return "one";
|
|
30
30
|
}
|
|
31
31
|
return "other";
|
package/locale-data/wa.d.ts
CHANGED
|
File without changes
|
package/locale-data/wa.js
CHANGED
|
@@ -10,7 +10,7 @@ if (Intl.PluralRules && typeof Intl.PluralRules.__addLocaleData === 'function')
|
|
|
10
10
|
if (isOrdinal) {
|
|
11
11
|
}
|
|
12
12
|
else {
|
|
13
|
-
if ((n >= 0 && n <= 1))
|
|
13
|
+
if ((!/[1-9]/.test(decimalPart) && (n >= 0 && n <= 1)))
|
|
14
14
|
return "one";
|
|
15
15
|
}
|
|
16
16
|
return "other";
|
|
@@ -25,7 +25,7 @@ if (Intl.PluralRules && typeof Intl.PluralRules.__addLocaleData === 'function')
|
|
|
25
25
|
if (isOrdinal) {
|
|
26
26
|
}
|
|
27
27
|
else {
|
|
28
|
-
if ((n >= 0 && n <= 1))
|
|
28
|
+
if ((!/[1-9]/.test(decimalPart) && (n >= 0 && n <= 1)))
|
|
29
29
|
return "one";
|
|
30
30
|
}
|
|
31
31
|
return "other";
|
package/locale-data/wae.d.ts
CHANGED
|
File without changes
|
package/locale-data/wae.js
CHANGED
|
@@ -10,7 +10,7 @@ if (Intl.PluralRules && typeof Intl.PluralRules.__addLocaleData === 'function')
|
|
|
10
10
|
if (isOrdinal) {
|
|
11
11
|
}
|
|
12
12
|
else {
|
|
13
|
-
if (n === 1)
|
|
13
|
+
if ((!/[1-9]/.test(decimalPart) && n === 1))
|
|
14
14
|
return "one";
|
|
15
15
|
}
|
|
16
16
|
return "other";
|
|
@@ -25,7 +25,7 @@ if (Intl.PluralRules && typeof Intl.PluralRules.__addLocaleData === 'function')
|
|
|
25
25
|
if (isOrdinal) {
|
|
26
26
|
}
|
|
27
27
|
else {
|
|
28
|
-
if (n === 1)
|
|
28
|
+
if ((!/[1-9]/.test(decimalPart) && n === 1))
|
|
29
29
|
return "one";
|
|
30
30
|
}
|
|
31
31
|
return "other";
|
package/locale-data/wo.d.ts
CHANGED
|
File without changes
|
package/locale-data/wo.js
CHANGED
|
File without changes
|
package/locale-data/xh.d.ts
CHANGED
|
File without changes
|
package/locale-data/xh.js
CHANGED
|
@@ -10,7 +10,7 @@ if (Intl.PluralRules && typeof Intl.PluralRules.__addLocaleData === 'function')
|
|
|
10
10
|
if (isOrdinal) {
|
|
11
11
|
}
|
|
12
12
|
else {
|
|
13
|
-
if (n === 1)
|
|
13
|
+
if ((!/[1-9]/.test(decimalPart) && n === 1))
|
|
14
14
|
return "one";
|
|
15
15
|
}
|
|
16
16
|
return "other";
|
|
@@ -25,7 +25,7 @@ if (Intl.PluralRules && typeof Intl.PluralRules.__addLocaleData === 'function')
|
|
|
25
25
|
if (isOrdinal) {
|
|
26
26
|
}
|
|
27
27
|
else {
|
|
28
|
-
if (n === 1)
|
|
28
|
+
if ((!/[1-9]/.test(decimalPart) && n === 1))
|
|
29
29
|
return "one";
|
|
30
30
|
}
|
|
31
31
|
return "other";
|
package/locale-data/xog.d.ts
CHANGED
|
File without changes
|
package/locale-data/xog.js
CHANGED
|
@@ -10,7 +10,7 @@ if (Intl.PluralRules && typeof Intl.PluralRules.__addLocaleData === 'function')
|
|
|
10
10
|
if (isOrdinal) {
|
|
11
11
|
}
|
|
12
12
|
else {
|
|
13
|
-
if (n === 1)
|
|
13
|
+
if ((!/[1-9]/.test(decimalPart) && n === 1))
|
|
14
14
|
return "one";
|
|
15
15
|
}
|
|
16
16
|
return "other";
|
|
@@ -25,7 +25,7 @@ if (Intl.PluralRules && typeof Intl.PluralRules.__addLocaleData === 'function')
|
|
|
25
25
|
if (isOrdinal) {
|
|
26
26
|
}
|
|
27
27
|
else {
|
|
28
|
-
if (n === 1)
|
|
28
|
+
if ((!/[1-9]/.test(decimalPart) && n === 1))
|
|
29
29
|
return "one";
|
|
30
30
|
}
|
|
31
31
|
return "other";
|
package/locale-data/yi.d.ts
CHANGED
|
File without changes
|
package/locale-data/yi.js
CHANGED
|
File without changes
|
package/locale-data/yo.d.ts
CHANGED
|
File without changes
|
package/locale-data/yo.js
CHANGED
|
File without changes
|
package/locale-data/yue.d.ts
CHANGED
|
File without changes
|
package/locale-data/yue.js
CHANGED
|
File without changes
|
package/locale-data/zh.d.ts
CHANGED
|
File without changes
|
package/locale-data/zh.js
CHANGED
|
File without changes
|
package/locale-data/zu.d.ts
CHANGED
|
File without changes
|
package/locale-data/zu.js
CHANGED
|
@@ -11,7 +11,7 @@ if (Intl.PluralRules && typeof Intl.PluralRules.__addLocaleData === 'function')
|
|
|
11
11
|
if (isOrdinal) {
|
|
12
12
|
}
|
|
13
13
|
else {
|
|
14
|
-
if (i === 0 || n === 1)
|
|
14
|
+
if (i === 0 || (!/[1-9]/.test(decimalPart) && n === 1))
|
|
15
15
|
return "one";
|
|
16
16
|
}
|
|
17
17
|
return "other";
|
|
@@ -27,7 +27,7 @@ if (Intl.PluralRules && typeof Intl.PluralRules.__addLocaleData === 'function')
|
|
|
27
27
|
if (isOrdinal) {
|
|
28
28
|
}
|
|
29
29
|
else {
|
|
30
|
-
if (i === 0 || n === 1)
|
|
30
|
+
if (i === 0 || (!/[1-9]/.test(decimalPart) && n === 1))
|
|
31
31
|
return "one";
|
|
32
32
|
}
|
|
33
33
|
return "other";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@formatjs/intl-pluralrules",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.4.0",
|
|
4
4
|
"description": "Polyfill for Intl.PluralRules",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"PluralRules",
|
|
@@ -30,6 +30,6 @@
|
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@formatjs/bigdecimal": "0.2.7",
|
|
33
|
-
"@formatjs/intl-localematcher": "0.
|
|
33
|
+
"@formatjs/intl-localematcher": "0.10.0"
|
|
34
34
|
}
|
|
35
35
|
}
|
package/polyfill-force.d.ts
CHANGED
|
File without changes
|
package/polyfill-force.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { LookupSupportedLocales, ResolveLocale } from "@formatjs/intl-localematcher";
|
|
2
|
-
import
|
|
2
|
+
import { Decimal } from "@formatjs/bigdecimal";
|
|
3
3
|
//#region node_modules/.aspect_rules_js/@formatjs_generated+cldr.supported-locales@0.0.0/node_modules/@formatjs_generated/cldr.supported-locales/default-content.js
|
|
4
4
|
const defaultContent = {
|
|
5
5
|
"aa": ["aa-ET"],
|
|
@@ -507,6 +507,13 @@ function ToIntlMathematicalValue(input) {
|
|
|
507
507
|
if (typeof input === "bigint") return new Decimal(input.toString());
|
|
508
508
|
let primValue = ToPrimitive(input, "number");
|
|
509
509
|
if (typeof primValue === "symbol") throw new TypeError("Cannot convert a Symbol value to a number");
|
|
510
|
+
if (typeof primValue === "string") {
|
|
511
|
+
const rounded = +primValue;
|
|
512
|
+
if (rounded !== rounded || rounded === Infinity || rounded === -Infinity || rounded === 0) return new Decimal(rounded);
|
|
513
|
+
const text = primValue.trim();
|
|
514
|
+
if (/^0[xob]/i.test(text)) return new Decimal(BigInt(text));
|
|
515
|
+
primValue = text;
|
|
516
|
+
}
|
|
510
517
|
if (primValue === void 0) return new Decimal(NaN);
|
|
511
518
|
if (primValue === true) return new Decimal(1);
|
|
512
519
|
if (primValue === false) return new Decimal(0);
|
|
@@ -1135,59 +1142,6 @@ function FormatNumericToString(intlObject, _x) {
|
|
|
1135
1142
|
};
|
|
1136
1143
|
}
|
|
1137
1144
|
//#endregion
|
|
1138
|
-
//#region packages/ecma402-abstract/PluralRules/GetOperands.js
|
|
1139
|
-
/**
|
|
1140
|
-
* CLDR operands for the implementation-defined PluralRuleSelect
|
|
1141
|
-
* ECMA-402 §17.5.1 PluralRuleSelect, decimalString parameter and return definition.
|
|
1142
|
-
* https://tc39.es/ecma402/#sec-pluralruleselect
|
|
1143
|
-
* https://github.com/tc39/ecma402/blob/b1c961988b9a07894b1dc3dc2b5626ea48387d61/spec/pluralrules.html#L285-L290
|
|
1144
|
-
*
|
|
1145
|
-
* Implementation: Extended to support compact exponent (c/e operands)
|
|
1146
|
-
*
|
|
1147
|
-
* @param s Formatted number string
|
|
1148
|
-
* @param exponent Compact decimal exponent (c/e operand), defaults to 0
|
|
1149
|
-
*/
|
|
1150
|
-
function GetOperands(s, exponent = 0) {
|
|
1151
|
-
invariant(typeof s === "string", `GetOperands should have been called with a string`);
|
|
1152
|
-
const n = new Decimal$1(s);
|
|
1153
|
-
invariant(n.isFinite(), "n should be finite");
|
|
1154
|
-
let dp = s.indexOf(".");
|
|
1155
|
-
let iv;
|
|
1156
|
-
let f;
|
|
1157
|
-
let v;
|
|
1158
|
-
let fv = "";
|
|
1159
|
-
if (dp === -1) {
|
|
1160
|
-
iv = s;
|
|
1161
|
-
f = ZERO;
|
|
1162
|
-
v = 0;
|
|
1163
|
-
} else {
|
|
1164
|
-
iv = s.slice(0, dp);
|
|
1165
|
-
fv = s.slice(dp, s.length);
|
|
1166
|
-
f = new Decimal$1(fv);
|
|
1167
|
-
v = fv.length;
|
|
1168
|
-
}
|
|
1169
|
-
const i = new Decimal$1(iv).abs();
|
|
1170
|
-
let w;
|
|
1171
|
-
let t;
|
|
1172
|
-
if (!f.isZero()) {
|
|
1173
|
-
const ft = fv.replace(/0+$/, "");
|
|
1174
|
-
w = ft.length;
|
|
1175
|
-
t = new Decimal$1(ft);
|
|
1176
|
-
} else {
|
|
1177
|
-
w = 0;
|
|
1178
|
-
t = ZERO;
|
|
1179
|
-
}
|
|
1180
|
-
return {
|
|
1181
|
-
Number: n,
|
|
1182
|
-
IntegerDigits: i.lessThanOrEqualTo(Number.MAX_SAFE_INTEGER) && i.greaterThanOrEqualTo(-Number.MAX_SAFE_INTEGER) ? i.toNumber() : i.toString(),
|
|
1183
|
-
NumberOfFractionDigits: v,
|
|
1184
|
-
NumberOfFractionDigitsWithoutTrailing: w,
|
|
1185
|
-
FractionDigits: f.toNumber(),
|
|
1186
|
-
FractionDigitsWithoutTrailing: t.toNumber(),
|
|
1187
|
-
CompactExponent: exponent
|
|
1188
|
-
};
|
|
1189
|
-
}
|
|
1190
|
-
//#endregion
|
|
1191
1145
|
//#region packages/ecma402-abstract/PluralRules/ResolvePlural.js
|
|
1192
1146
|
/**
|
|
1193
1147
|
* ResolvePluralInternal ( pluralRules, n )
|
|
@@ -1232,7 +1186,7 @@ function ResolvePluralInternal(pl, n, { getInternalSlots, PluralRuleSelect }) {
|
|
|
1232
1186
|
}
|
|
1233
1187
|
return {
|
|
1234
1188
|
formattedString: s,
|
|
1235
|
-
pluralCategory: PluralRuleSelect(locale, type,
|
|
1189
|
+
pluralCategory: PluralRuleSelect(locale, type, s, exponent)
|
|
1236
1190
|
};
|
|
1237
1191
|
}
|
|
1238
1192
|
/**
|
|
@@ -1300,14 +1254,10 @@ function validateInstance(instance, method) {
|
|
|
1300
1254
|
if (!(instance instanceof PluralRules)) throw new TypeError(`Method Intl.PluralRules.prototype.${method} called on incompatible receiver ${String(instance)}`);
|
|
1301
1255
|
}
|
|
1302
1256
|
/**
|
|
1303
|
-
*
|
|
1304
|
-
* @param locale
|
|
1305
|
-
* @param type
|
|
1306
|
-
* @param _n
|
|
1307
|
-
* @param param3
|
|
1257
|
+
* https://tc39.es/ecma402/#sec-pluralruleselect
|
|
1308
1258
|
*/
|
|
1309
|
-
function PluralRuleSelect(locale, type,
|
|
1310
|
-
return PluralRules.localeData[locale].fn(
|
|
1259
|
+
function PluralRuleSelect(locale, type, decimalString, exponent) {
|
|
1260
|
+
return PluralRules.localeData[locale].fn(decimalString, type === "ordinal", exponent);
|
|
1311
1261
|
}
|
|
1312
1262
|
/**
|
|
1313
1263
|
* PluralRuleSelectRange ( locale, type, notation, compactDisplay, start, end )
|
|
@@ -1442,7 +1392,8 @@ var PluralRules = class PluralRules {
|
|
|
1442
1392
|
return SupportedLocales(PluralRules.availableLocales, CanonicalizeLocaleList(locales), options);
|
|
1443
1393
|
}
|
|
1444
1394
|
static __addLocaleData(...data) {
|
|
1445
|
-
for (const { data: d, locale } of data) {
|
|
1395
|
+
for (const { data: d, locale: tag } of data) {
|
|
1396
|
+
const [locale] = CanonicalizeLocaleList(tag);
|
|
1446
1397
|
registerLocaleData(locale, d, PluralRules.localeData, PluralRules.availableLocales);
|
|
1447
1398
|
if (!PluralRules.__defaultLocale) PluralRules.__defaultLocale = locale;
|
|
1448
1399
|
}
|