make-plural 6.2.0 → 7.1.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "make-plural",
3
- "version": "6.2.0",
3
+ "version": "7.1.0",
4
4
  "description": "Unicode CLDR pluralization rules as JavaScript functions",
5
5
  "keywords": [
6
6
  "unicode",
@@ -10,7 +10,7 @@
10
10
  "pluralization"
11
11
  ],
12
12
  "author": "Eemeli Aro <eemeli@gmail.com>",
13
- "license": "ISC",
13
+ "license": "Unicode-DFS-2016",
14
14
  "homepage": "https://github.com/eemeli/make-plural#readme",
15
15
  "repository": {
16
16
  "type": "git",
@@ -22,30 +22,74 @@
22
22
  },
23
23
  "files": [
24
24
  "cardinals.*",
25
+ "examples.*",
25
26
  "ordinals.*",
26
27
  "plurals.*",
27
- "pluralCategories.*"
28
+ "pluralCategories.*",
29
+ "ranges.*"
28
30
  ],
29
- "main": "plurals",
30
- "module": "plurals.mjs",
31
+ "type": "commonjs",
31
32
  "sideEffects": false,
32
- "scripts": {
33
- "build": "npm run build:mjs && npm run build:umd && npm run build:dts",
34
- "build:dts": "npm run cardinals:dts && npm run ordinals:dts && npm run plurals:dts && npm run plural-categories:dts",
35
- "build:mjs": "npm run cardinals:mjs && npm run ordinals:mjs && npm run plurals:mjs && npm run plural-categories:mjs",
36
- "build:umd": "npm run cardinals:umd && npm run ordinals:umd && npm run plurals:umd && npm run plural-categories:umd",
37
- "cardinals:dts": "../cli/make-plural plurals --no-ordinals --dts > cardinals.d.ts",
38
- "cardinals:mjs": "../cli/make-plural plurals --no-ordinals -w118 > cardinals.mjs",
39
- "cardinals:umd": "../cli/make-plural plurals --no-ordinals --umd -w118 > cardinals.js",
40
- "ordinals:dts": "../cli/make-plural plurals --no-cardinals --dts > ordinals.d.ts",
41
- "ordinals:mjs": "../cli/make-plural plurals --no-cardinals -w118 > ordinals.mjs",
42
- "ordinals:umd": "../cli/make-plural plurals --no-cardinals --umd -w118 > ordinals.js",
43
- "plurals:dts": "../cli/make-plural plurals --dts > plurals.d.ts",
44
- "plurals:mjs": "../cli/make-plural plurals -w118 > plurals.mjs",
45
- "plurals:umd": "../cli/make-plural plurals --umd -w118 > plurals.js",
46
- "plural-categories:dts": "../cli/make-plural categories --dts > pluralCategories.d.ts",
47
- "plural-categories:mjs": "../cli/make-plural categories > pluralCategories.mjs",
48
- "plural-categories:umd": "../cli/make-plural categories --umd > pluralCategories.js"
33
+ "main": "./plurals.js",
34
+ "module": "./plurals.mjs",
35
+ "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
+ ],
57
+ "./ordinals": [
58
+ {
59
+ "import": "./ordinals.mjs",
60
+ "require": "./ordinals.js"
61
+ },
62
+ "./ordinals.js"
63
+ ],
64
+ "./pluralCategories": [
65
+ {
66
+ "import": "./pluralCategories.mjs",
67
+ "require": "./pluralCategories.js"
68
+ },
69
+ "./pluralCategories.js"
70
+ ],
71
+ "./plurals": [
72
+ {
73
+ "import": "./plurals.mjs",
74
+ "require": "./plurals.js"
75
+ },
76
+ "./plurals.js"
77
+ ],
78
+ "./ranges": [
79
+ {
80
+ "import": "./ranges.mjs",
81
+ "require": "./ranges.js"
82
+ },
83
+ "./ranges.js"
84
+ ],
85
+ "./package.json": "./package.json"
49
86
  },
50
- "gitHead": "ee0a491de38be447ab6c0bebeedf01979fa217d4"
87
+ "browser": {
88
+ "./cardinals.js": "./cardinals.mjs",
89
+ "./examples.js": "./examples.mjs",
90
+ "./ordinals.js": "./ordinals.mjs",
91
+ "./pluralCategories.js": "./pluralCategories.mjs",
92
+ "./plurals.js": "./plurals.mjs",
93
+ "./ranges.js": "./ranges.mjs"
94
+ }
51
95
  }
@@ -1,6 +1,5 @@
1
1
  export type PluralCategory = "zero" | "one" | "two" | "few" | "many" | "other";
2
2
 
3
- export const _in: {cardinal:["other"],ordinal:["other"]};
4
3
  export const af: {cardinal:["one","other"],ordinal:["other"]};
5
4
  export const ak: {cardinal:["one","other"],ordinal:["other"]};
6
5
  export const am: {cardinal:["one","other"],ordinal:["other"]};
@@ -11,6 +10,7 @@ export const as: {cardinal:["one","other"],ordinal:["one","two","few","many","ot
11
10
  export const asa: {cardinal:["one","other"],ordinal:["other"]};
12
11
  export const ast: {cardinal:["one","other"],ordinal:["other"]};
13
12
  export const az: {cardinal:["one","other"],ordinal:["one","few","many","other"]};
13
+ export const bal: {cardinal:["one","other"],ordinal:["one","other"]};
14
14
  export const be: {cardinal:["one","few","many","other"],ordinal:["few","other"]};
15
15
  export const bem: {cardinal:["one","other"],ordinal:["other"]};
16
16
  export const bez: {cardinal:["one","other"],ordinal:["other"]};
@@ -32,6 +32,7 @@ export const cs: {cardinal:["one","few","many","other"],ordinal:["other"]};
32
32
  export const cy: {cardinal:["zero","one","two","few","many","other"],ordinal:["zero","one","two","few","many","other"]};
33
33
  export const da: {cardinal:["one","other"],ordinal:["other"]};
34
34
  export const de: {cardinal:["one","other"],ordinal:["other"]};
35
+ export const doi: {cardinal:["one","other"],ordinal:["other"]};
35
36
  export const dsb: {cardinal:["one","two","few","other"],ordinal:["other"]};
36
37
  export const dv: {cardinal:["one","other"],ordinal:["other"]};
37
38
  export const dz: {cardinal:["other"],ordinal:["other"]};
@@ -39,7 +40,7 @@ export const ee: {cardinal:["one","other"],ordinal:["other"]};
39
40
  export const el: {cardinal:["one","other"],ordinal:["other"]};
40
41
  export const en: {cardinal:["one","other"],ordinal:["one","two","few","other"]};
41
42
  export const eo: {cardinal:["one","other"],ordinal:["other"]};
42
- export const es: {cardinal:["one","other"],ordinal:["other"]};
43
+ export const es: {cardinal:["one","many","other"],ordinal:["other"]};
43
44
  export const et: {cardinal:["one","other"],ordinal:["other"]};
44
45
  export const eu: {cardinal:["one","other"],ordinal:["other"]};
45
46
  export const fa: {cardinal:["one","other"],ordinal:["other"]};
@@ -47,7 +48,7 @@ export const ff: {cardinal:["one","other"],ordinal:["other"]};
47
48
  export const fi: {cardinal:["one","other"],ordinal:["other"]};
48
49
  export const fil: {cardinal:["one","other"],ordinal:["one","other"]};
49
50
  export const fo: {cardinal:["one","other"],ordinal:["other"]};
50
- export const fr: {cardinal:["one","other"],ordinal:["one","other"]};
51
+ export const fr: {cardinal:["one","many","other"],ordinal:["one","other"]};
51
52
  export const fur: {cardinal:["one","other"],ordinal:["other"]};
52
53
  export const fy: {cardinal:["one","other"],ordinal:["other"]};
53
54
  export const ga: {cardinal:["one","two","few","many","other"],ordinal:["one","other"]};
@@ -61,6 +62,7 @@ export const ha: {cardinal:["one","other"],ordinal:["other"]};
61
62
  export const haw: {cardinal:["one","other"],ordinal:["other"]};
62
63
  export const he: {cardinal:["one","two","many","other"],ordinal:["other"]};
63
64
  export const hi: {cardinal:["one","other"],ordinal:["one","two","few","many","other"]};
65
+ export const hnj: {cardinal:["other"],ordinal:["other"]};
64
66
  export const hr: {cardinal:["one","few","other"],ordinal:["other"]};
65
67
  export const hsb: {cardinal:["one","two","few","other"],ordinal:["other"]};
66
68
  export const hu: {cardinal:["one","other"],ordinal:["one","other"]};
@@ -71,13 +73,11 @@ export const ig: {cardinal:["other"],ordinal:["other"]};
71
73
  export const ii: {cardinal:["other"],ordinal:["other"]};
72
74
  export const io: {cardinal:["one","other"],ordinal:["other"]};
73
75
  export const is: {cardinal:["one","other"],ordinal:["other"]};
74
- export const it: {cardinal:["one","other"],ordinal:["many","other"]};
76
+ export const it: {cardinal:["one","many","other"],ordinal:["many","other"]};
75
77
  export const iu: {cardinal:["one","two","other"],ordinal:["other"]};
76
- export const iw: {cardinal:["one","two","many","other"],ordinal:["other"]};
77
78
  export const ja: {cardinal:["other"],ordinal:["other"]};
78
79
  export const jbo: {cardinal:["other"],ordinal:["other"]};
79
80
  export const jgo: {cardinal:["one","other"],ordinal:["other"]};
80
- export const ji: {cardinal:["one","other"],ordinal:["other"]};
81
81
  export const jmc: {cardinal:["one","other"],ordinal:["other"]};
82
82
  export const jv: {cardinal:["other"],ordinal:["other"]};
83
83
  export const jw: {cardinal:["other"],ordinal:["other"]};
@@ -102,6 +102,7 @@ export const ky: {cardinal:["one","other"],ordinal:["other"]};
102
102
  export const lag: {cardinal:["zero","one","other"],ordinal:["other"]};
103
103
  export const lb: {cardinal:["one","other"],ordinal:["other"]};
104
104
  export const lg: {cardinal:["one","other"],ordinal:["other"]};
105
+ export const lij: {cardinal:["one","other"],ordinal:["many","other"]};
105
106
  export const lkt: {cardinal:["other"],ordinal:["other"]};
106
107
  export const ln: {cardinal:["one","other"],ordinal:["other"]};
107
108
  export const lo: {cardinal:["other"],ordinal:["one","other"]};
@@ -138,19 +139,20 @@ export const os: {cardinal:["one","other"],ordinal:["other"]};
138
139
  export const osa: {cardinal:["other"],ordinal:["other"]};
139
140
  export const pa: {cardinal:["one","other"],ordinal:["other"]};
140
141
  export const pap: {cardinal:["one","other"],ordinal:["other"]};
142
+ export const pcm: {cardinal:["one","other"],ordinal:["other"]};
141
143
  export const pl: {cardinal:["one","few","many","other"],ordinal:["other"]};
142
144
  export const prg: {cardinal:["zero","one","other"],ordinal:["other"]};
143
145
  export const ps: {cardinal:["one","other"],ordinal:["other"]};
144
- export const pt: {cardinal:["one","other"],ordinal:["other"]};
145
- export const pt_PT: {cardinal:["one","other"],ordinal:["other"]};
146
+ export const pt: {cardinal:["one","many","other"],ordinal:["other"]};
147
+ export const pt_PT: {cardinal:["one","many","other"],ordinal:["other"]};
146
148
  export const rm: {cardinal:["one","other"],ordinal:["other"]};
147
149
  export const ro: {cardinal:["one","few","other"],ordinal:["one","other"]};
148
150
  export const rof: {cardinal:["one","other"],ordinal:["other"]};
149
- export const root: {cardinal:["other"],ordinal:["other"]};
150
151
  export const ru: {cardinal:["one","few","many","other"],ordinal:["other"]};
151
152
  export const rwk: {cardinal:["one","other"],ordinal:["other"]};
152
153
  export const sah: {cardinal:["other"],ordinal:["other"]};
153
154
  export const saq: {cardinal:["one","other"],ordinal:["other"]};
155
+ export const sat: {cardinal:["one","two","other"],ordinal:["other"]};
154
156
  export const sc: {cardinal:["one","other"],ordinal:["many","other"]};
155
157
  export const scn: {cardinal:["one","other"],ordinal:["many","other"]};
156
158
  export const sd: {cardinal:["one","other"],ordinal:["other"]};
@@ -190,11 +192,13 @@ export const tk: {cardinal:["one","other"],ordinal:["few","other"]};
190
192
  export const tl: {cardinal:["one","other"],ordinal:["one","other"]};
191
193
  export const tn: {cardinal:["one","other"],ordinal:["other"]};
192
194
  export const to: {cardinal:["other"],ordinal:["other"]};
195
+ export const tpi: {cardinal:["other"],ordinal:["other"]};
193
196
  export const tr: {cardinal:["one","other"],ordinal:["other"]};
194
197
  export const ts: {cardinal:["one","other"],ordinal:["other"]};
195
198
  export const tzm: {cardinal:["one","other"],ordinal:["other"]};
196
199
  export const ug: {cardinal:["one","other"],ordinal:["other"]};
197
200
  export const uk: {cardinal:["one","few","many","other"],ordinal:["few","other"]};
201
+ export const und: {cardinal:["other"],ordinal:["other"]};
198
202
  export const ur: {cardinal:["one","other"],ordinal:["other"]};
199
203
  export const uz: {cardinal:["one","other"],ordinal:["other"]};
200
204
  export const ve: {cardinal:["one","other"],ordinal:["other"]};
@@ -1,21 +1,16 @@
1
1
  var z = "zero", o = "one", t = "two", f = "few", m = "many", x = "other";
2
2
  var a = {cardinal:[o,x],ordinal:[x]};
3
- var b = {cardinal:[x],ordinal:[x]};
4
- var c = {cardinal:[o,f,m,x],ordinal:[x]};
5
- var d = {cardinal:[o,x],ordinal:[o,x]};
3
+ var b = {cardinal:[o,x],ordinal:[o,x]};
4
+ var c = {cardinal:[x],ordinal:[x]};
5
+ var d = {cardinal:[o,f,m,x],ordinal:[x]};
6
6
  var e = {cardinal:[o,t,x],ordinal:[x]};
7
7
 
8
8
  (function (root, pluralCategories) {
9
9
  Object.defineProperty(pluralCategories, '__esModule', { value: true });
10
- if (typeof define === 'function' && define.amd) {
11
- define(pluralCategories);
12
- } else if (typeof exports === 'object') {
13
- module.exports = pluralCategories;
14
- } else {
15
- root.pluralCategories = pluralCategories;
16
- }
10
+ if (typeof define === 'function' && define.amd) define(pluralCategories);
11
+ else if (typeof exports === 'object') module.exports = pluralCategories;
12
+ else root.pluralCategories = pluralCategories;
17
13
  }(this, {
18
- _in: b,
19
14
  af: a,
20
15
  ak: a,
21
16
  am: a,
@@ -26,14 +21,15 @@ as: {cardinal:[o,x],ordinal:[o,t,f,m,x]},
26
21
  asa: a,
27
22
  ast: a,
28
23
  az: {cardinal:[o,x],ordinal:[o,f,m,x]},
24
+ bal: b,
29
25
  be: {cardinal:[o,f,m,x],ordinal:[f,x]},
30
26
  bem: a,
31
27
  bez: a,
32
28
  bg: a,
33
29
  bho: a,
34
- bm: b,
30
+ bm: c,
35
31
  bn: {cardinal:[o,x],ordinal:[o,t,f,m,x]},
36
- bo: b,
32
+ bo: c,
37
33
  br: {cardinal:[o,t,f,m,x],ordinal:[x]},
38
34
  brx: a,
39
35
  bs: {cardinal:[o,f,x],ordinal:[x]},
@@ -43,26 +39,27 @@ ceb: a,
43
39
  cgg: a,
44
40
  chr: a,
45
41
  ckb: a,
46
- cs: c,
42
+ cs: d,
47
43
  cy: {cardinal:[z,o,t,f,m,x],ordinal:[z,o,t,f,m,x]},
48
44
  da: a,
49
45
  de: a,
46
+ doi: a,
50
47
  dsb: {cardinal:[o,t,f,x],ordinal:[x]},
51
48
  dv: a,
52
- dz: b,
49
+ dz: c,
53
50
  ee: a,
54
51
  el: a,
55
52
  en: {cardinal:[o,x],ordinal:[o,t,f,x]},
56
53
  eo: a,
57
- es: a,
54
+ es: {cardinal:[o,m,x],ordinal:[x]},
58
55
  et: a,
59
56
  eu: a,
60
57
  fa: a,
61
58
  ff: a,
62
59
  fi: a,
63
- fil: d,
60
+ fil: b,
64
61
  fo: a,
65
- fr: d,
62
+ fr: {cardinal:[o,m,x],ordinal:[o,x]},
66
63
  fur: a,
67
64
  fy: a,
68
65
  ga: {cardinal:[o,t,f,m,x],ordinal:[o,x]},
@@ -76,38 +73,37 @@ ha: a,
76
73
  haw: a,
77
74
  he: {cardinal:[o,t,m,x],ordinal:[x]},
78
75
  hi: {cardinal:[o,x],ordinal:[o,t,f,m,x]},
76
+ hnj: c,
79
77
  hr: {cardinal:[o,f,x],ordinal:[x]},
80
78
  hsb: {cardinal:[o,t,f,x],ordinal:[x]},
81
- hu: d,
82
- hy: d,
79
+ hu: b,
80
+ hy: b,
83
81
  ia: a,
84
- id: b,
85
- ig: b,
86
- ii: b,
82
+ id: c,
83
+ ig: c,
84
+ ii: c,
87
85
  io: a,
88
86
  is: a,
89
- it: {cardinal:[o,x],ordinal:[m,x]},
87
+ it: {cardinal:[o,m,x],ordinal:[m,x]},
90
88
  iu: e,
91
- iw: {cardinal:[o,t,m,x],ordinal:[x]},
92
- ja: b,
93
- jbo: b,
89
+ ja: c,
90
+ jbo: c,
94
91
  jgo: a,
95
- ji: a,
96
92
  jmc: a,
97
- jv: b,
98
- jw: b,
93
+ jv: c,
94
+ jw: c,
99
95
  ka: {cardinal:[o,x],ordinal:[o,m,x]},
100
96
  kab: a,
101
97
  kaj: a,
102
98
  kcg: a,
103
- kde: b,
104
- kea: b,
99
+ kde: c,
100
+ kea: c,
105
101
  kk: {cardinal:[o,x],ordinal:[m,x]},
106
102
  kkj: a,
107
103
  kl: a,
108
- km: b,
104
+ km: c,
109
105
  kn: a,
110
- ko: b,
106
+ ko: c,
111
107
  ks: a,
112
108
  ksb: a,
113
109
  ksh: {cardinal:[z,o,x],ordinal:[x]},
@@ -117,10 +113,11 @@ ky: a,
117
113
  lag: {cardinal:[z,o,x],ordinal:[x]},
118
114
  lb: a,
119
115
  lg: a,
120
- lkt: b,
116
+ lij: {cardinal:[o,x],ordinal:[m,x]},
117
+ lkt: c,
121
118
  ln: a,
122
119
  lo: {cardinal:[x],ordinal:[o,x]},
123
- lt: c,
120
+ lt: d,
124
121
  lv: {cardinal:[z,o,x],ordinal:[x]},
125
122
  mas: a,
126
123
  mg: a,
@@ -131,18 +128,18 @@ mn: a,
131
128
  mo: {cardinal:[o,f,x],ordinal:[o,x]},
132
129
  mr: {cardinal:[o,x],ordinal:[o,t,f,x]},
133
130
  ms: {cardinal:[x],ordinal:[o,x]},
134
- mt: c,
135
- my: b,
131
+ mt: d,
132
+ my: c,
136
133
  nah: a,
137
134
  naq: e,
138
135
  nb: a,
139
136
  nd: a,
140
- ne: d,
137
+ ne: b,
141
138
  nl: a,
142
139
  nn: a,
143
140
  nnh: a,
144
141
  no: a,
145
- nqo: b,
142
+ nqo: c,
146
143
  nr: a,
147
144
  nso: a,
148
145
  ny: a,
@@ -150,34 +147,35 @@ nyn: a,
150
147
  om: a,
151
148
  or: {cardinal:[o,x],ordinal:[o,t,f,m,x]},
152
149
  os: a,
153
- osa: b,
150
+ osa: c,
154
151
  pa: a,
155
152
  pap: a,
156
- pl: c,
153
+ pcm: a,
154
+ pl: d,
157
155
  prg: {cardinal:[z,o,x],ordinal:[x]},
158
156
  ps: a,
159
- pt: a,
160
- pt_PT: a,
157
+ pt: {cardinal:[o,m,x],ordinal:[x]},
158
+ pt_PT: {cardinal:[o,m,x],ordinal:[x]},
161
159
  rm: a,
162
160
  ro: {cardinal:[o,f,x],ordinal:[o,x]},
163
161
  rof: a,
164
- root: b,
165
- ru: c,
162
+ ru: d,
166
163
  rwk: a,
167
- sah: b,
164
+ sah: c,
168
165
  saq: a,
166
+ sat: e,
169
167
  sc: {cardinal:[o,x],ordinal:[m,x]},
170
168
  scn: {cardinal:[o,x],ordinal:[m,x]},
171
169
  sd: a,
172
170
  sdh: a,
173
171
  se: e,
174
172
  seh: a,
175
- ses: b,
176
- sg: b,
173
+ ses: c,
174
+ sg: c,
177
175
  sh: {cardinal:[o,f,x],ordinal:[x]},
178
176
  shi: {cardinal:[o,f,x],ordinal:[x]},
179
177
  si: a,
180
- sk: c,
178
+ sk: d,
181
179
  sl: {cardinal:[o,t,f,x],ordinal:[x]},
182
180
  sma: e,
183
181
  smi: e,
@@ -191,25 +189,27 @@ sr: {cardinal:[o,f,x],ordinal:[x]},
191
189
  ss: a,
192
190
  ssy: a,
193
191
  st: a,
194
- su: b,
195
- sv: d,
192
+ su: c,
193
+ sv: b,
196
194
  sw: a,
197
195
  syr: a,
198
196
  ta: a,
199
197
  te: a,
200
198
  teo: a,
201
- th: b,
199
+ th: c,
202
200
  ti: a,
203
201
  tig: a,
204
202
  tk: {cardinal:[o,x],ordinal:[f,x]},
205
- tl: d,
203
+ tl: b,
206
204
  tn: a,
207
- to: b,
205
+ to: c,
206
+ tpi: c,
208
207
  tr: a,
209
208
  ts: a,
210
209
  tzm: a,
211
210
  ug: a,
212
211
  uk: {cardinal:[o,f,m,x],ordinal:[f,x]},
212
+ und: c,
213
213
  ur: a,
214
214
  uz: a,
215
215
  ve: a,
@@ -218,12 +218,12 @@ vo: a,
218
218
  vun: a,
219
219
  wa: a,
220
220
  wae: a,
221
- wo: b,
221
+ wo: c,
222
222
  xh: a,
223
223
  xog: a,
224
224
  yi: a,
225
- yo: b,
226
- yue: b,
227
- zh: b,
225
+ yo: c,
226
+ yue: c,
227
+ zh: c,
228
228
  zu: a
229
229
  }));