make-plural 7.5.0 → 8.0.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/ordinals.js CHANGED
@@ -1,331 +1,217 @@
1
1
  const a = (n) => 'other';
2
2
  const b = (n) => n == 1 ? 'one' : 'other';
3
3
 
4
- (function (root, plurals) {
5
- Object.defineProperty(plurals, '__esModule', { value: true });
6
- if (typeof define === 'function' && define.amd) define(plurals);
7
- else if (typeof exports === 'object') module.exports = plurals;
8
- else root.plurals = plurals;
9
- }(this, {
10
- af: a,
11
-
12
- am: a,
13
-
14
- an: a,
15
-
16
- ar: a,
17
-
18
- as: (n) => (n == 1 || n == 5 || n == 7 || n == 8 || n == 9 || n == 10) ? 'one'
4
+ export const af = a;
5
+ export const am = a;
6
+ export const an = a;
7
+ export const ar = a;
8
+ export const as = (n) => (n == 1 || n == 5 || n == 7 || n == 8 || n == 9 || n == 10) ? 'one'
19
9
  : (n == 2 || n == 3) ? 'two'
20
10
  : n == 4 ? 'few'
21
11
  : n == 6 ? 'many'
22
- : 'other',
23
-
24
- ast: a,
25
-
26
- az: (n) => {
12
+ : 'other';
13
+ export const ast = a;
14
+ export const az = (n) => {
27
15
  const s = String(n).split('.'), i = s[0], i10 = i.slice(-1), i100 = i.slice(-2), i1000 = i.slice(-3);
28
16
  return (i10 == 1 || i10 == 2 || i10 == 5 || i10 == 7 || i10 == 8) || (i100 == 20 || i100 == 50 || i100 == 70 || i100 == 80) ? 'one'
29
17
  : (i10 == 3 || i10 == 4) || (i1000 == 100 || i1000 == 200 || i1000 == 300 || i1000 == 400 || i1000 == 500 || i1000 == 600 || i1000 == 700 || i1000 == 800 || i1000 == 900) ? 'few'
30
18
  : i == 0 || i10 == 6 || (i100 == 40 || i100 == 60 || i100 == 90) ? 'many'
31
19
  : 'other';
32
- },
33
-
34
- bal: b,
35
-
36
- be: (n) => {
20
+ };
21
+ export const bal = b;
22
+ export const be = (n) => {
37
23
  const s = String(n).split('.'), t0 = Number(s[0]) == n, n10 = t0 && s[0].slice(-1), n100 = t0 && s[0].slice(-2);
38
24
  return (n10 == 2 || n10 == 3) && n100 != 12 && n100 != 13 ? 'few' : 'other';
39
- },
40
-
41
- bg: a,
42
-
43
- blo: (n) => {
25
+ };
26
+ export const bg = a;
27
+ export const blo = (n) => {
44
28
  const s = String(n).split('.'), i = s[0];
45
29
  return i == 0 ? 'zero'
46
30
  : i == 1 ? 'one'
47
31
  : (i == 2 || i == 3 || i == 4 || i == 5 || i == 6) ? 'few'
48
32
  : 'other';
49
- },
50
-
51
- bn: (n) => (n == 1 || n == 5 || n == 7 || n == 8 || n == 9 || n == 10) ? 'one'
33
+ };
34
+ export const bn = (n) => (n == 1 || n == 5 || n == 7 || n == 8 || n == 9 || n == 10) ? 'one'
52
35
  : (n == 2 || n == 3) ? 'two'
53
36
  : n == 4 ? 'few'
54
37
  : n == 6 ? 'many'
55
- : 'other',
56
-
57
- bs: a,
58
-
59
- ca: (n) => (n == 1 || n == 3) ? 'one'
38
+ : 'other';
39
+ export const bs = a;
40
+ export const ca = (n) => (n == 1 || n == 3) ? 'one'
60
41
  : n == 2 ? 'two'
61
42
  : n == 4 ? 'few'
62
- : 'other',
63
-
64
- ce: a,
65
-
66
- cs: a,
67
-
68
- cv: a,
69
-
70
- cy: (n) => (n == 0 || n == 7 || n == 8 || n == 9) ? 'zero'
43
+ : 'other';
44
+ export const ce = a;
45
+ export const cs = a;
46
+ export const cv = a;
47
+ export const cy = (n) => (n == 0 || n == 7 || n == 8 || n == 9) ? 'zero'
71
48
  : n == 1 ? 'one'
72
49
  : n == 2 ? 'two'
73
50
  : (n == 3 || n == 4) ? 'few'
74
51
  : (n == 5 || n == 6) ? 'many'
75
- : 'other',
76
-
77
- da: a,
78
-
79
- de: a,
80
-
81
- dsb: a,
82
-
83
- el: a,
84
-
85
- en: (n) => {
52
+ : 'other';
53
+ export const da = a;
54
+ export const de = a;
55
+ export const dsb = a;
56
+ export const el = a;
57
+ export const en = (n) => {
86
58
  const s = String(n).split('.'), t0 = Number(s[0]) == n, n10 = t0 && s[0].slice(-1), n100 = t0 && s[0].slice(-2);
87
59
  return n10 == 1 && n100 != 11 ? 'one'
88
60
  : n10 == 2 && n100 != 12 ? 'two'
89
61
  : n10 == 3 && n100 != 13 ? 'few'
90
62
  : 'other';
91
- },
92
-
93
- es: a,
94
-
95
- et: a,
96
-
97
- eu: a,
98
-
99
- fa: a,
100
-
101
- fi: a,
102
-
103
- fil: b,
104
-
105
- fr: b,
106
-
107
- fy: a,
108
-
109
- ga: b,
110
-
111
- gd: (n) => (n == 1 || n == 11) ? 'one'
63
+ };
64
+ export const es = a;
65
+ export const et = a;
66
+ export const eu = a;
67
+ export const fa = a;
68
+ export const fi = a;
69
+ export const fil = b;
70
+ export const fr = b;
71
+ export const fy = a;
72
+ export const ga = b;
73
+ export const gd = (n) => (n == 1 || n == 11) ? 'one'
112
74
  : (n == 2 || n == 12) ? 'two'
113
75
  : (n == 3 || n == 13) ? 'few'
114
- : 'other',
115
-
116
- gl: a,
117
-
118
- gsw: a,
119
-
120
- gu: (n) => n == 1 ? 'one'
76
+ : 'other';
77
+ export const gl = a;
78
+ export const gsw = a;
79
+ export const gu = (n) => n == 1 ? 'one'
121
80
  : (n == 2 || n == 3) ? 'two'
122
81
  : n == 4 ? 'few'
123
82
  : n == 6 ? 'many'
124
- : 'other',
125
-
126
- he: a,
127
-
128
- hi: (n) => n == 1 ? 'one'
83
+ : 'other';
84
+ export const he = a;
85
+ export const hi = (n) => n == 1 ? 'one'
129
86
  : (n == 2 || n == 3) ? 'two'
130
87
  : n == 4 ? 'few'
131
88
  : n == 6 ? 'many'
132
- : 'other',
133
-
134
- hr: a,
135
-
136
- hsb: a,
137
-
138
- hu: (n) => (n == 1 || n == 5) ? 'one' : 'other',
139
-
140
- hy: b,
141
-
142
- ia: a,
143
-
144
- id: a,
145
-
146
- ie: a,
147
-
148
- is: a,
149
-
150
- it: (n) => (n == 11 || n == 8 || n == 80 || n == 800) ? 'many' : 'other',
151
-
152
- ja: a,
153
-
154
- ka: (n) => {
89
+ : 'other';
90
+ export const hr = a;
91
+ export const hsb = a;
92
+ export const hu = (n) => (n == 1 || n == 5) ? 'one' : 'other';
93
+ export const hy = b;
94
+ export const ia = a;
95
+ export const id = a;
96
+ export const ie = a;
97
+ export const is = a;
98
+ export const it = (n) => (n == 11 || n == 8 || n == 80 || n == 800) ? 'many' : 'other';
99
+ export const ja = a;
100
+ export const ka = (n) => {
155
101
  const s = String(n).split('.'), i = s[0], i100 = i.slice(-2);
156
102
  return i == 1 ? 'one'
157
103
  : i == 0 || ((i100 >= 2 && i100 <= 20) || i100 == 40 || i100 == 60 || i100 == 80) ? 'many'
158
104
  : 'other';
159
- },
160
-
161
- kk: (n) => {
105
+ };
106
+ export const kk = (n) => {
162
107
  const s = String(n).split('.'), t0 = Number(s[0]) == n, n10 = t0 && s[0].slice(-1);
163
108
  return n10 == 6 || n10 == 9 || t0 && n10 == 0 && n != 0 ? 'many' : 'other';
164
- },
165
-
166
- km: a,
167
-
168
- kn: a,
169
-
170
- ko: a,
171
-
172
- kok: (n) => n == 1 ? 'one'
109
+ };
110
+ export const km = a;
111
+ export const kn = a;
112
+ export const ko = a;
113
+ export const kok = (n) => n == 1 ? 'one'
173
114
  : (n == 2 || n == 3) ? 'two'
174
115
  : n == 4 ? 'few'
175
- : 'other',
176
-
177
- kok_Latn: (n) => n == 1 ? 'one'
116
+ : 'other';
117
+ export const kok_Latn = (n) => n == 1 ? 'one'
178
118
  : (n == 2 || n == 3) ? 'two'
179
119
  : n == 4 ? 'few'
180
- : 'other',
181
-
182
- kw: (n) => {
120
+ : 'other';
121
+ export const kw = (n) => {
183
122
  const s = String(n).split('.'), t0 = Number(s[0]) == n, n100 = t0 && s[0].slice(-2);
184
123
  return (t0 && n >= 1 && n <= 4) || ((n100 >= 1 && n100 <= 4) || (n100 >= 21 && n100 <= 24) || (n100 >= 41 && n100 <= 44) || (n100 >= 61 && n100 <= 64) || (n100 >= 81 && n100 <= 84)) ? 'one'
185
124
  : n == 5 || n100 == 5 ? 'many'
186
125
  : 'other';
187
- },
188
-
189
- ky: a,
190
-
191
- lij: (n) => {
126
+ };
127
+ export const ky = a;
128
+ export const lij = (n) => {
192
129
  const s = String(n).split('.'), t0 = Number(s[0]) == n;
193
130
  return (n == 11 || n == 8 || (t0 && n >= 80 && n <= 89) || (t0 && n >= 800 && n <= 899)) ? 'many' : 'other';
194
- },
195
-
196
- lld: (n) => (n == 11 || n == 8 || n == 80 || n == 800) ? 'many' : 'other',
197
-
198
- lo: b,
199
-
200
- lt: a,
201
-
202
- lv: a,
203
-
204
- mk: (n) => {
131
+ };
132
+ export const lld = (n) => (n == 11 || n == 8 || n == 80 || n == 800) ? 'many' : 'other';
133
+ export const lo = b;
134
+ export const lt = a;
135
+ export const lv = a;
136
+ export const mk = (n) => {
205
137
  const s = String(n).split('.'), i = s[0], i10 = i.slice(-1), i100 = i.slice(-2);
206
138
  return i10 == 1 && i100 != 11 ? 'one'
207
139
  : i10 == 2 && i100 != 12 ? 'two'
208
140
  : (i10 == 7 || i10 == 8) && i100 != 17 && i100 != 18 ? 'many'
209
141
  : 'other';
210
- },
211
-
212
- ml: a,
213
-
214
- mn: a,
215
-
216
- mo: b,
217
-
218
- mr: (n) => n == 1 ? 'one'
142
+ };
143
+ export const ml = a;
144
+ export const mn = a;
145
+ export const mo = b;
146
+ export const mr = (n) => n == 1 ? 'one'
219
147
  : (n == 2 || n == 3) ? 'two'
220
148
  : n == 4 ? 'few'
221
- : 'other',
222
-
223
- ms: b,
224
-
225
- my: a,
226
-
227
- nb: a,
228
-
229
- ne: (n) => {
149
+ : 'other';
150
+ export const ms = b;
151
+ export const my = a;
152
+ export const nb = a;
153
+ export const ne = (n) => {
230
154
  const s = String(n).split('.'), t0 = Number(s[0]) == n;
231
155
  return (t0 && n >= 1 && n <= 4) ? 'one' : 'other';
232
- },
233
-
234
- nl: a,
235
-
236
- no: a,
237
-
238
- or: (n) => {
156
+ };
157
+ export const nl = a;
158
+ export const no = a;
159
+ export const or = (n) => {
239
160
  const s = String(n).split('.'), t0 = Number(s[0]) == n;
240
161
  return (n == 1 || n == 5 || (t0 && n >= 7 && n <= 9)) ? 'one'
241
162
  : (n == 2 || n == 3) ? 'two'
242
163
  : n == 4 ? 'few'
243
164
  : n == 6 ? 'many'
244
165
  : 'other';
245
- },
246
-
247
- pa: a,
248
-
249
- pl: a,
250
-
251
- prg: a,
252
-
253
- ps: a,
254
-
255
- pt: a,
256
-
257
- ro: b,
258
-
259
- ru: a,
260
-
261
- sc: (n) => (n == 11 || n == 8 || n == 80 || n == 800) ? 'many' : 'other',
262
-
263
- scn: (n) => {
166
+ };
167
+ export const pa = a;
168
+ export const pl = a;
169
+ export const prg = a;
170
+ export const ps = a;
171
+ export const pt = a;
172
+ export const ro = b;
173
+ export const ru = a;
174
+ export const sc = (n) => (n == 11 || n == 8 || n == 80 || n == 800) ? 'many' : 'other';
175
+ export const scn = (n) => {
264
176
  const s = String(n).split('.'), t0 = Number(s[0]) == n;
265
177
  return (n == 11 || n == 8 || (t0 && n >= 80 && n <= 89) || (t0 && n >= 800 && n <= 899)) ? 'many' : 'other';
266
- },
267
-
268
- sd: a,
269
-
270
- sh: a,
271
-
272
- si: a,
273
-
274
- sk: a,
275
-
276
- sl: a,
277
-
278
- sq: (n) => {
178
+ };
179
+ export const sd = a;
180
+ export const sh = a;
181
+ export const si = a;
182
+ export const sk = a;
183
+ export const sl = a;
184
+ export const sq = (n) => {
279
185
  const s = String(n).split('.'), t0 = Number(s[0]) == n, n10 = t0 && s[0].slice(-1), n100 = t0 && s[0].slice(-2);
280
186
  return n == 1 ? 'one'
281
187
  : n10 == 4 && n100 != 14 ? 'many'
282
188
  : 'other';
283
- },
284
-
285
- sr: a,
286
-
287
- sv: (n) => {
189
+ };
190
+ export const sr = a;
191
+ export const sv = (n) => {
288
192
  const s = String(n).split('.'), t0 = Number(s[0]) == n, n10 = t0 && s[0].slice(-1), n100 = t0 && s[0].slice(-2);
289
193
  return (n10 == 1 || n10 == 2) && n100 != 11 && n100 != 12 ? 'one' : 'other';
290
- },
291
-
292
- sw: a,
293
-
294
- ta: a,
295
-
296
- te: a,
297
-
298
- th: a,
299
-
300
- tk: (n) => {
194
+ };
195
+ export const sw = a;
196
+ export const ta = a;
197
+ export const te = a;
198
+ export const th = a;
199
+ export const tk = (n) => {
301
200
  const s = String(n).split('.'), t0 = Number(s[0]) == n, n10 = t0 && s[0].slice(-1);
302
201
  return (n10 == 6 || n10 == 9) || n == 10 ? 'few' : 'other';
303
- },
304
-
305
- tl: b,
306
-
307
- tpi: a,
308
-
309
- tr: a,
310
-
311
- uk: (n) => {
202
+ };
203
+ export const tl = b;
204
+ export const tpi = a;
205
+ export const tr = a;
206
+ export const uk = (n) => {
312
207
  const s = String(n).split('.'), t0 = Number(s[0]) == n, n10 = t0 && s[0].slice(-1), n100 = t0 && s[0].slice(-2);
313
208
  return n10 == 3 && n100 != 13 ? 'few' : 'other';
314
- },
315
-
316
- und: a,
317
-
318
- ur: a,
319
-
320
- uz: a,
321
-
322
- vec: (n) => (n == 11 || n == 8 || n == 80 || n == 800) ? 'many' : 'other',
323
-
324
- vi: b,
325
-
326
- yue: a,
327
-
328
- zh: a,
329
-
330
- zu: a
331
- }));
209
+ };
210
+ export const und = a;
211
+ export const ur = a;
212
+ export const uz = a;
213
+ export const vec = (n) => (n == 11 || n == 8 || n == 80 || n == 800) ? 'many' : 'other';
214
+ export const vi = b;
215
+ export const yue = a;
216
+ export const zh = a;
217
+ export const zu = a;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "make-plural",
3
- "version": "7.5.0",
3
+ "version": "8.0.0",
4
4
  "description": "Unicode CLDR pluralization rules as JavaScript functions",
5
5
  "keywords": [
6
6
  "unicode",
@@ -28,69 +28,17 @@
28
28
  "pluralCategories.*",
29
29
  "ranges.*"
30
30
  ],
31
- "type": "commonjs",
31
+ "type": "module",
32
32
  "sideEffects": false,
33
- "main": "./plurals.js",
34
- "module": "./plurals.mjs",
35
33
  "exports": {
36
- ".": [
37
- {
38
- "import": "./plurals.mjs",
39
- "require": "./plurals.js"
40
- },
41
- "./plurals.js"
42
- ],
43
- "./cardinals": [
44
- {
45
- "import": "./cardinals.mjs",
46
- "require": "./cardinals.js"
47
- },
48
- "./cardinals.js"
49
- ],
50
- "./examples": [
51
- {
52
- "import": "./examples.mjs",
53
- "require": "./examples.js"
54
- },
55
- "./examples.js"
56
- ],
34
+ ".": "./plurals.js",
35
+ "./cardinals": "./cardinals.js",
36
+ "./examples": "./examples.js",
57
37
  "./examples.json": "./examples.json",
58
- "./ordinals": [
59
- {
60
- "import": "./ordinals.mjs",
61
- "require": "./ordinals.js"
62
- },
63
- "./ordinals.js"
64
- ],
65
- "./pluralCategories": [
66
- {
67
- "import": "./pluralCategories.mjs",
68
- "require": "./pluralCategories.js"
69
- },
70
- "./pluralCategories.js"
71
- ],
72
- "./plurals": [
73
- {
74
- "import": "./plurals.mjs",
75
- "require": "./plurals.js"
76
- },
77
- "./plurals.js"
78
- ],
79
- "./ranges": [
80
- {
81
- "import": "./ranges.mjs",
82
- "require": "./ranges.js"
83
- },
84
- "./ranges.js"
85
- ],
38
+ "./ordinals": "./ordinals.js",
39
+ "./pluralCategories": "./pluralCategories.js",
40
+ "./plurals": "./plurals.js",
41
+ "./ranges": "./ranges.js",
86
42
  "./package.json": "./package.json"
87
- },
88
- "browser": {
89
- "./cardinals.js": "./cardinals.mjs",
90
- "./examples.js": "./examples.mjs",
91
- "./ordinals.js": "./ordinals.mjs",
92
- "./pluralCategories.js": "./pluralCategories.mjs",
93
- "./plurals.js": "./plurals.mjs",
94
- "./ranges.js": "./ranges.mjs"
95
43
  }
96
44
  }