make-plural 7.1.0 → 7.2.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.
@@ -2,8 +2,7 @@ const z = "zero", o = "one", t = "two", f = "few", m = "many", x = "other";
2
2
  const a = {cardinal:[o,x],ordinal:[x]};
3
3
  const b = {cardinal:[o,x],ordinal:[o,x]};
4
4
  const c = {cardinal:[x],ordinal:[x]};
5
- const d = {cardinal:[o,f,m,x],ordinal:[x]};
6
- const e = {cardinal:[o,t,x],ordinal:[x]};
5
+ const d = {cardinal:[o,t,x],ordinal:[x]};
7
6
 
8
7
  export const af = a;
9
8
  export const ak = a;
@@ -27,13 +26,13 @@ export const bo = c;
27
26
  export const br = {cardinal:[o,t,f,m,x],ordinal:[x]};
28
27
  export const brx = a;
29
28
  export const bs = {cardinal:[o,f,x],ordinal:[x]};
30
- export const ca = {cardinal:[o,x],ordinal:[o,t,f,x]};
29
+ export const ca = {cardinal:[o,m,x],ordinal:[o,t,f,x]};
31
30
  export const ce = a;
32
31
  export const ceb = a;
33
32
  export const cgg = a;
34
33
  export const chr = a;
35
34
  export const ckb = a;
36
- export const cs = d;
35
+ export const cs = {cardinal:[o,f,m,x],ordinal:[x]};
37
36
  export const cy = {cardinal:[z,o,t,f,m,x],ordinal:[z,o,t,f,m,x]};
38
37
  export const da = a;
39
38
  export const de = a;
@@ -65,7 +64,7 @@ export const guw = a;
65
64
  export const gv = {cardinal:[o,t,f,m,x],ordinal:[x]};
66
65
  export const ha = a;
67
66
  export const haw = a;
68
- export const he = {cardinal:[o,t,m,x],ordinal:[x]};
67
+ export const he = d;
69
68
  export const hi = {cardinal:[o,x],ordinal:[o,t,f,m,x]};
70
69
  export const hnj = c;
71
70
  export const hr = {cardinal:[o,f,x],ordinal:[x]};
@@ -79,7 +78,7 @@ export const ii = c;
79
78
  export const io = a;
80
79
  export const is = a;
81
80
  export const it = {cardinal:[o,m,x],ordinal:[m,x]};
82
- export const iu = e;
81
+ export const iu = d;
83
82
  export const ja = c;
84
83
  export const jbo = c;
85
84
  export const jgo = a;
@@ -111,7 +110,7 @@ export const lij = {cardinal:[o,x],ordinal:[m,x]};
111
110
  export const lkt = c;
112
111
  export const ln = a;
113
112
  export const lo = {cardinal:[x],ordinal:[o,x]};
114
- export const lt = d;
113
+ export const lt = {cardinal:[o,f,m,x],ordinal:[x]};
115
114
  export const lv = {cardinal:[z,o,x],ordinal:[x]};
116
115
  export const mas = a;
117
116
  export const mg = a;
@@ -122,10 +121,10 @@ export const mn = a;
122
121
  export const mo = {cardinal:[o,f,x],ordinal:[o,x]};
123
122
  export const mr = {cardinal:[o,x],ordinal:[o,t,f,x]};
124
123
  export const ms = {cardinal:[x],ordinal:[o,x]};
125
- export const mt = d;
124
+ export const mt = {cardinal:[o,t,f,m,x],ordinal:[x]};
126
125
  export const my = c;
127
126
  export const nah = a;
128
- export const naq = e;
127
+ export const naq = d;
129
128
  export const nb = a;
130
129
  export const nd = a;
131
130
  export const ne = b;
@@ -145,7 +144,7 @@ export const osa = c;
145
144
  export const pa = a;
146
145
  export const pap = a;
147
146
  export const pcm = a;
148
- export const pl = d;
147
+ export const pl = {cardinal:[o,f,m,x],ordinal:[x]};
149
148
  export const prg = {cardinal:[z,o,x],ordinal:[x]};
150
149
  export const ps = a;
151
150
  export const pt = {cardinal:[o,m,x],ordinal:[x]};
@@ -153,29 +152,29 @@ export const pt_PT = {cardinal:[o,m,x],ordinal:[x]};
153
152
  export const rm = a;
154
153
  export const ro = {cardinal:[o,f,x],ordinal:[o,x]};
155
154
  export const rof = a;
156
- export const ru = d;
155
+ export const ru = {cardinal:[o,f,m,x],ordinal:[x]};
157
156
  export const rwk = a;
158
157
  export const sah = c;
159
158
  export const saq = a;
160
- export const sat = e;
159
+ export const sat = d;
161
160
  export const sc = {cardinal:[o,x],ordinal:[m,x]};
162
161
  export const scn = {cardinal:[o,x],ordinal:[m,x]};
163
162
  export const sd = a;
164
163
  export const sdh = a;
165
- export const se = e;
164
+ export const se = d;
166
165
  export const seh = a;
167
166
  export const ses = c;
168
167
  export const sg = c;
169
168
  export const sh = {cardinal:[o,f,x],ordinal:[x]};
170
169
  export const shi = {cardinal:[o,f,x],ordinal:[x]};
171
170
  export const si = a;
172
- export const sk = d;
171
+ export const sk = {cardinal:[o,f,m,x],ordinal:[x]};
173
172
  export const sl = {cardinal:[o,t,f,x],ordinal:[x]};
174
- export const sma = e;
175
- export const smi = e;
176
- export const smj = e;
177
- export const smn = e;
178
- export const sms = e;
173
+ export const sma = d;
174
+ export const smi = d;
175
+ export const smj = d;
176
+ export const smn = d;
177
+ export const sms = d;
179
178
  export const sn = a;
180
179
  export const so = a;
181
180
  export const sq = {cardinal:[o,x],ordinal:[o,m,x]};
@@ -207,6 +206,7 @@ export const und = c;
207
206
  export const ur = a;
208
207
  export const uz = a;
209
208
  export const ve = a;
209
+ export const vec = {cardinal:[o,m,x],ordinal:[m,x]};
210
210
  export const vi = {cardinal:[x],ordinal:[o,x]};
211
211
  export const vo = a;
212
212
  export const vun = a;
package/plurals.d.ts CHANGED
@@ -22,7 +22,7 @@ export const bo: (n: number | string, ord?: boolean) => "other";
22
22
  export const br: (n: number | string, ord?: boolean) => "one" | "two" | "few" | "many" | "other";
23
23
  export const brx: (n: number | string, ord?: boolean) => "one" | "other";
24
24
  export const bs: (n: number | string, ord?: boolean) => "one" | "few" | "other";
25
- export const ca: (n: number | string, ord?: boolean) => "one" | "two" | "few" | "other";
25
+ export const ca: (n: number | string, ord?: boolean) => "one" | "two" | "few" | "many" | "other";
26
26
  export const ce: (n: number | string, ord?: boolean) => "one" | "other";
27
27
  export const ceb: (n: number | string, ord?: boolean) => "one" | "other";
28
28
  export const cgg: (n: number | string, ord?: boolean) => "one" | "other";
@@ -60,7 +60,7 @@ export const guw: (n: number | string, ord?: boolean) => "one" | "other";
60
60
  export const gv: (n: number | string, ord?: boolean) => "one" | "two" | "few" | "many" | "other";
61
61
  export const ha: (n: number | string, ord?: boolean) => "one" | "other";
62
62
  export const haw: (n: number | string, ord?: boolean) => "one" | "other";
63
- export const he: (n: number | string, ord?: boolean) => "one" | "two" | "many" | "other";
63
+ export const he: (n: number | string, ord?: boolean) => "one" | "two" | "other";
64
64
  export const hi: (n: number | string, ord?: boolean) => "one" | "two" | "few" | "many" | "other";
65
65
  export const hnj: (n: number | string, ord?: boolean) => "other";
66
66
  export const hr: (n: number | string, ord?: boolean) => "one" | "few" | "other";
@@ -117,7 +117,7 @@ export const mn: (n: number | string, ord?: boolean) => "one" | "other";
117
117
  export const mo: (n: number | string, ord?: boolean) => "one" | "few" | "other";
118
118
  export const mr: (n: number | string, ord?: boolean) => "one" | "two" | "few" | "other";
119
119
  export const ms: (n: number | string, ord?: boolean) => "one" | "other";
120
- export const mt: (n: number | string, ord?: boolean) => "one" | "few" | "many" | "other";
120
+ export const mt: (n: number | string, ord?: boolean) => "one" | "two" | "few" | "many" | "other";
121
121
  export const my: (n: number | string, ord?: boolean) => "other";
122
122
  export const nah: (n: number | string, ord?: boolean) => "one" | "other";
123
123
  export const naq: (n: number | string, ord?: boolean) => "one" | "two" | "other";
@@ -202,6 +202,7 @@ export const und: (n: number | string, ord?: boolean) => "other";
202
202
  export const ur: (n: number | string, ord?: boolean) => "one" | "other";
203
203
  export const uz: (n: number | string, ord?: boolean) => "one" | "other";
204
204
  export const ve: (n: number | string, ord?: boolean) => "one" | "other";
205
+ export const vec: (n: number | string, ord?: boolean) => "one" | "many" | "other";
205
206
  export const vi: (n: number | string, ord?: boolean) => "one" | "other";
206
207
  export const vo: (n: number | string, ord?: boolean) => "one" | "other";
207
208
  export const vun: (n: number | string, ord?: boolean) => "one" | "other";
package/plurals.js CHANGED
@@ -134,12 +134,14 @@ bs: (n, ord) => {
134
134
  },
135
135
 
136
136
  ca: (n, ord) => {
137
- const s = String(n).split('.'), v0 = !s[1];
137
+ const s = String(n).split('.'), i = s[0], v0 = !s[1], i1000000 = i.slice(-6);
138
138
  if (ord) return (n == 1 || n == 3) ? 'one'
139
139
  : n == 2 ? 'two'
140
140
  : n == 4 ? 'few'
141
141
  : 'other';
142
- return n == 1 && v0 ? 'one' : 'other';
142
+ return n == 1 && v0 ? 'one'
143
+ : i != 0 && i1000000 == 0 && v0 ? 'many'
144
+ : 'other';
143
145
  },
144
146
 
145
147
  ce: a,
@@ -311,11 +313,10 @@ ha: a,
311
313
  haw: a,
312
314
 
313
315
  he: (n, ord) => {
314
- const s = String(n).split('.'), i = s[0], v0 = !s[1], t0 = Number(s[0]) == n, n10 = t0 && s[0].slice(-1);
316
+ const s = String(n).split('.'), i = s[0], v0 = !s[1];
315
317
  if (ord) return 'other';
316
- return n == 1 && v0 ? 'one'
318
+ return i == 1 && v0 || i == 0 && !v0 ? 'one'
317
319
  : i == 2 && v0 ? 'two'
318
- : v0 && (n < 0 || n > 10) && t0 && n10 == 0 ? 'many'
319
320
  : 'other';
320
321
  },
321
322
 
@@ -368,9 +369,9 @@ ii: e,
368
369
  io: d,
369
370
 
370
371
  is: (n, ord) => {
371
- const s = String(n).split('.'), i = s[0], t0 = Number(s[0]) == n, i10 = i.slice(-1), i100 = i.slice(-2);
372
+ const s = String(n).split('.'), i = s[0], t = (s[1] || '').replace(/0+$/, ''), t0 = Number(s[0]) == n, i10 = i.slice(-1), i100 = i.slice(-2);
372
373
  if (ord) return 'other';
373
- return t0 && i10 == 1 && i100 != 11 || !t0 ? 'one' : 'other';
374
+ return t0 && i10 == 1 && i100 != 11 || t % 10 == 1 && t % 100 != 11 ? 'one' : 'other';
374
375
  },
375
376
 
376
377
  it: (n, ord) => {
@@ -527,7 +528,7 @@ mo: (n, ord) => {
527
528
  const s = String(n).split('.'), v0 = !s[1], t0 = Number(s[0]) == n, n100 = t0 && s[0].slice(-2);
528
529
  if (ord) return n == 1 ? 'one' : 'other';
529
530
  return n == 1 && v0 ? 'one'
530
- : !v0 || n == 0 || (n100 >= 2 && n100 <= 19) ? 'few'
531
+ : !v0 || n == 0 || n != 1 && (n100 >= 1 && n100 <= 19) ? 'few'
531
532
  : 'other';
532
533
  },
533
534
 
@@ -548,7 +549,8 @@ mt: (n, ord) => {
548
549
  const s = String(n).split('.'), t0 = Number(s[0]) == n, n100 = t0 && s[0].slice(-2);
549
550
  if (ord) return 'other';
550
551
  return n == 1 ? 'one'
551
- : n == 0 || (n100 >= 2 && n100 <= 10) ? 'few'
552
+ : n == 2 ? 'two'
553
+ : n == 0 || (n100 >= 3 && n100 <= 10) ? 'few'
552
554
  : (n100 >= 11 && n100 <= 19) ? 'many'
553
555
  : 'other';
554
556
  },
@@ -650,7 +652,7 @@ ro: (n, ord) => {
650
652
  const s = String(n).split('.'), v0 = !s[1], t0 = Number(s[0]) == n, n100 = t0 && s[0].slice(-2);
651
653
  if (ord) return n == 1 ? 'one' : 'other';
652
654
  return n == 1 && v0 ? 'one'
653
- : !v0 || n == 0 || (n100 >= 2 && n100 <= 19) ? 'few'
655
+ : !v0 || n == 0 || n != 1 && (n100 >= 1 && n100 <= 19) ? 'few'
654
656
  : 'other';
655
657
  },
656
658
 
@@ -844,6 +846,14 @@ uz: a,
844
846
 
845
847
  ve: a,
846
848
 
849
+ vec: (n, ord) => {
850
+ const s = String(n).split('.'), i = s[0], v0 = !s[1], i1000000 = i.slice(-6);
851
+ if (ord) return (n == 11 || n == 8 || n == 80 || n == 800) ? 'many' : 'other';
852
+ return n == 1 && v0 ? 'one'
853
+ : i != 0 && i1000000 == 0 && v0 ? 'many'
854
+ : 'other';
855
+ },
856
+
847
857
  vi: (n, ord) => {
848
858
  if (ord) return n == 1 ? 'one' : 'other';
849
859
  return 'other';
package/plurals.mjs CHANGED
@@ -106,12 +106,14 @@ export const bs = (n, ord) => {
106
106
  : 'other';
107
107
  };
108
108
  export const ca = (n, ord) => {
109
- const s = String(n).split('.'), v0 = !s[1];
109
+ const s = String(n).split('.'), i = s[0], v0 = !s[1], i1000000 = i.slice(-6);
110
110
  if (ord) return (n == 1 || n == 3) ? 'one'
111
111
  : n == 2 ? 'two'
112
112
  : n == 4 ? 'few'
113
113
  : 'other';
114
- return n == 1 && v0 ? 'one' : 'other';
114
+ return n == 1 && v0 ? 'one'
115
+ : i != 0 && i1000000 == 0 && v0 ? 'many'
116
+ : 'other';
115
117
  };
116
118
  export const ce = a;
117
119
  export const ceb = (n, ord) => {
@@ -245,11 +247,10 @@ export const gv = (n, ord) => {
245
247
  export const ha = a;
246
248
  export const haw = a;
247
249
  export const he = (n, ord) => {
248
- const s = String(n).split('.'), i = s[0], v0 = !s[1], t0 = Number(s[0]) == n, n10 = t0 && s[0].slice(-1);
250
+ const s = String(n).split('.'), i = s[0], v0 = !s[1];
249
251
  if (ord) return 'other';
250
- return n == 1 && v0 ? 'one'
252
+ return i == 1 && v0 || i == 0 && !v0 ? 'one'
251
253
  : i == 2 && v0 ? 'two'
252
- : v0 && (n < 0 || n > 10) && t0 && n10 == 0 ? 'many'
253
254
  : 'other';
254
255
  };
255
256
  export const hi = (n, ord) => {
@@ -290,9 +291,9 @@ export const ig = e;
290
291
  export const ii = e;
291
292
  export const io = d;
292
293
  export const is = (n, ord) => {
293
- const s = String(n).split('.'), i = s[0], t0 = Number(s[0]) == n, i10 = i.slice(-1), i100 = i.slice(-2);
294
+ const s = String(n).split('.'), i = s[0], t = (s[1] || '').replace(/0+$/, ''), t0 = Number(s[0]) == n, i10 = i.slice(-1), i100 = i.slice(-2);
294
295
  if (ord) return 'other';
295
- return t0 && i10 == 1 && i100 != 11 || !t0 ? 'one' : 'other';
296
+ return t0 && i10 == 1 && i100 != 11 || t % 10 == 1 && t % 100 != 11 ? 'one' : 'other';
296
297
  };
297
298
  export const it = (n, ord) => {
298
299
  const s = String(n).split('.'), i = s[0], v0 = !s[1], i1000000 = i.slice(-6);
@@ -407,7 +408,7 @@ export const mo = (n, ord) => {
407
408
  const s = String(n).split('.'), v0 = !s[1], t0 = Number(s[0]) == n, n100 = t0 && s[0].slice(-2);
408
409
  if (ord) return n == 1 ? 'one' : 'other';
409
410
  return n == 1 && v0 ? 'one'
410
- : !v0 || n == 0 || (n100 >= 2 && n100 <= 19) ? 'few'
411
+ : !v0 || n == 0 || n != 1 && (n100 >= 1 && n100 <= 19) ? 'few'
411
412
  : 'other';
412
413
  };
413
414
  export const mr = (n, ord) => {
@@ -425,7 +426,8 @@ export const mt = (n, ord) => {
425
426
  const s = String(n).split('.'), t0 = Number(s[0]) == n, n100 = t0 && s[0].slice(-2);
426
427
  if (ord) return 'other';
427
428
  return n == 1 ? 'one'
428
- : n == 0 || (n100 >= 2 && n100 <= 10) ? 'few'
429
+ : n == 2 ? 'two'
430
+ : n == 0 || (n100 >= 3 && n100 <= 10) ? 'few'
429
431
  : (n100 >= 11 && n100 <= 19) ? 'many'
430
432
  : 'other';
431
433
  };
@@ -498,7 +500,7 @@ export const ro = (n, ord) => {
498
500
  const s = String(n).split('.'), v0 = !s[1], t0 = Number(s[0]) == n, n100 = t0 && s[0].slice(-2);
499
501
  if (ord) return n == 1 ? 'one' : 'other';
500
502
  return n == 1 && v0 ? 'one'
501
- : !v0 || n == 0 || (n100 >= 2 && n100 <= 19) ? 'few'
503
+ : !v0 || n == 0 || n != 1 && (n100 >= 1 && n100 <= 19) ? 'few'
502
504
  : 'other';
503
505
  };
504
506
  export const rof = a;
@@ -636,6 +638,13 @@ export const und = e;
636
638
  export const ur = d;
637
639
  export const uz = a;
638
640
  export const ve = a;
641
+ export const vec = (n, ord) => {
642
+ const s = String(n).split('.'), i = s[0], v0 = !s[1], i1000000 = i.slice(-6);
643
+ if (ord) return (n == 11 || n == 8 || n == 80 || n == 800) ? 'many' : 'other';
644
+ return n == 1 && v0 ? 'one'
645
+ : i != 0 && i1000000 == 0 && v0 ? 'many'
646
+ : 'other';
647
+ };
639
648
  export const vi = (n, ord) => {
640
649
  if (ord) return n == 1 ? 'one' : 'other';
641
650
  return 'other';
package/ranges.d.ts CHANGED
@@ -29,7 +29,7 @@ export const ga: (start: PluralCategory, end: PluralCategory) => "one" | "two" |
29
29
  export const gl: (start: PluralCategory, end: PluralCategory) => "one" | "other";
30
30
  export const gsw: (start: PluralCategory, end: PluralCategory) => "one" | "other";
31
31
  export const gu: (start: PluralCategory, end: PluralCategory) => "one" | "other";
32
- export const he: (start: PluralCategory, end: PluralCategory) => "many" | "other";
32
+ export const he: (start: PluralCategory, end: PluralCategory) => "other";
33
33
  export const hi: (start: PluralCategory, end: PluralCategory) => "one" | "other";
34
34
  export const hr: (start: PluralCategory, end: PluralCategory) => "one" | "few" | "other";
35
35
  export const hu: (start: PluralCategory, end: PluralCategory) => "one" | "other";
package/ranges.js CHANGED
@@ -72,13 +72,7 @@ gsw: c,
72
72
 
73
73
  gu: c,
74
74
 
75
- he: (start, end) => (
76
- (start === "many" && end === "many") ? "many"
77
- : (start === "many" && end === "other") ? "many"
78
- : (start === "one" && end === "many") ? "many"
79
- : (start === "other" && end === "many") ? "many"
80
- : "other"
81
- ),
75
+ he: a,
82
76
 
83
77
  hi: c,
84
78
 
package/ranges.mjs CHANGED
@@ -37,13 +37,7 @@ export const ga = c;
37
37
  export const gl = c;
38
38
  export const gsw = c;
39
39
  export const gu = c;
40
- export const he = (start, end) => (
41
- (start === "many" && end === "many") ? "many"
42
- : (start === "many" && end === "other") ? "many"
43
- : (start === "one" && end === "many") ? "many"
44
- : (start === "other" && end === "many") ? "many"
45
- : "other"
46
- );
40
+ export const he = a;
47
41
  export const hi = c;
48
42
  export const hr = c;
49
43
  export const hu = c;