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/ranges.d.ts ADDED
@@ -0,0 +1,93 @@
1
+ export type PluralCategory = "zero" | "one" | "two" | "few" | "many" | "other";
2
+
3
+ export const af: (start: PluralCategory, end: PluralCategory) => "other";
4
+ export const ak: (start: PluralCategory, end: PluralCategory) => "one" | "other";
5
+ export const am: (start: PluralCategory, end: PluralCategory) => "one" | "other";
6
+ export const an: (start: PluralCategory, end: PluralCategory) => "other";
7
+ export const ar: (start: PluralCategory, end: PluralCategory) => "zero" | "few" | "many" | "other";
8
+ export const as: (start: PluralCategory, end: PluralCategory) => "one" | "other";
9
+ export const az: (start: PluralCategory, end: PluralCategory) => "one" | "other";
10
+ export const be: (start: PluralCategory, end: PluralCategory) => "one" | "few" | "many" | "other";
11
+ export const bg: (start: PluralCategory, end: PluralCategory) => "other";
12
+ export const bn: (start: PluralCategory, end: PluralCategory) => "one" | "other";
13
+ export const bs: (start: PluralCategory, end: PluralCategory) => "one" | "few" | "other";
14
+ export const ca: (start: PluralCategory, end: PluralCategory) => "other";
15
+ export const cs: (start: PluralCategory, end: PluralCategory) => "one" | "few" | "many" | "other";
16
+ export const cy: (start: PluralCategory, end: PluralCategory) => "one" | "two" | "few" | "many" | "other";
17
+ export const da: (start: PluralCategory, end: PluralCategory) => "one" | "other";
18
+ export const de: (start: PluralCategory, end: PluralCategory) => "one" | "other";
19
+ export const el: (start: PluralCategory, end: PluralCategory) => "one" | "other";
20
+ export const en: (start: PluralCategory, end: PluralCategory) => "other";
21
+ export const es: (start: PluralCategory, end: PluralCategory) => "other";
22
+ export const et: (start: PluralCategory, end: PluralCategory) => "other";
23
+ export const eu: (start: PluralCategory, end: PluralCategory) => "other";
24
+ export const fa: (start: PluralCategory, end: PluralCategory) => "one" | "other";
25
+ export const fi: (start: PluralCategory, end: PluralCategory) => "other";
26
+ export const fil: (start: PluralCategory, end: PluralCategory) => "one" | "other";
27
+ export const fr: (start: PluralCategory, end: PluralCategory) => "one" | "other";
28
+ export const ga: (start: PluralCategory, end: PluralCategory) => "one" | "two" | "few" | "many" | "other";
29
+ export const gl: (start: PluralCategory, end: PluralCategory) => "one" | "other";
30
+ export const gsw: (start: PluralCategory, end: PluralCategory) => "one" | "other";
31
+ export const gu: (start: PluralCategory, end: PluralCategory) => "one" | "other";
32
+ export const he: (start: PluralCategory, end: PluralCategory) => "many" | "other";
33
+ export const hi: (start: PluralCategory, end: PluralCategory) => "one" | "other";
34
+ export const hr: (start: PluralCategory, end: PluralCategory) => "one" | "few" | "other";
35
+ export const hu: (start: PluralCategory, end: PluralCategory) => "one" | "other";
36
+ export const hy: (start: PluralCategory, end: PluralCategory) => "one" | "other";
37
+ export const ia: (start: PluralCategory, end: PluralCategory) => "other";
38
+ export const id: (start: PluralCategory, end: PluralCategory) => "other";
39
+ export const io: (start: PluralCategory, end: PluralCategory) => "other";
40
+ export const is: (start: PluralCategory, end: PluralCategory) => "one" | "other";
41
+ export const it: (start: PluralCategory, end: PluralCategory) => "one" | "other";
42
+ export const ja: (start: PluralCategory, end: PluralCategory) => "other";
43
+ export const ka: (start: PluralCategory, end: PluralCategory) => "one" | "other";
44
+ export const kk: (start: PluralCategory, end: PluralCategory) => "one" | "other";
45
+ export const km: (start: PluralCategory, end: PluralCategory) => "other";
46
+ export const kn: (start: PluralCategory, end: PluralCategory) => "one" | "other";
47
+ export const ko: (start: PluralCategory, end: PluralCategory) => "other";
48
+ export const ky: (start: PluralCategory, end: PluralCategory) => "one" | "other";
49
+ export const lij: (start: PluralCategory, end: PluralCategory) => "one" | "other";
50
+ export const lo: (start: PluralCategory, end: PluralCategory) => "other";
51
+ export const lt: (start: PluralCategory, end: PluralCategory) => "one" | "few" | "many" | "other";
52
+ export const lv: (start: PluralCategory, end: PluralCategory) => "one" | "other";
53
+ export const mk: (start: PluralCategory, end: PluralCategory) => "other";
54
+ export const ml: (start: PluralCategory, end: PluralCategory) => "one" | "other";
55
+ export const mn: (start: PluralCategory, end: PluralCategory) => "one" | "other";
56
+ export const mr: (start: PluralCategory, end: PluralCategory) => "one" | "other";
57
+ export const ms: (start: PluralCategory, end: PluralCategory) => "other";
58
+ export const my: (start: PluralCategory, end: PluralCategory) => "other";
59
+ export const nb: (start: PluralCategory, end: PluralCategory) => "other";
60
+ export const ne: (start: PluralCategory, end: PluralCategory) => "one" | "other";
61
+ export const nl: (start: PluralCategory, end: PluralCategory) => "one" | "other";
62
+ export const no: (start: PluralCategory, end: PluralCategory) => "other";
63
+ export const or: (start: PluralCategory, end: PluralCategory) => "one" | "other";
64
+ export const pa: (start: PluralCategory, end: PluralCategory) => "one" | "other";
65
+ export const pcm: (start: PluralCategory, end: PluralCategory) => "other";
66
+ export const pl: (start: PluralCategory, end: PluralCategory) => "one" | "few" | "many" | "other";
67
+ export const ps: (start: PluralCategory, end: PluralCategory) => "one" | "other";
68
+ export const pt: (start: PluralCategory, end: PluralCategory) => "one" | "other";
69
+ export const ro: (start: PluralCategory, end: PluralCategory) => "few" | "other";
70
+ export const ru: (start: PluralCategory, end: PluralCategory) => "one" | "few" | "many" | "other";
71
+ export const sc: (start: PluralCategory, end: PluralCategory) => "one" | "other";
72
+ export const scn: (start: PluralCategory, end: PluralCategory) => "one" | "other";
73
+ export const sd: (start: PluralCategory, end: PluralCategory) => "one" | "other";
74
+ export const si: (start: PluralCategory, end: PluralCategory) => "one" | "other";
75
+ export const sk: (start: PluralCategory, end: PluralCategory) => "one" | "few" | "many" | "other";
76
+ export const sl: (start: PluralCategory, end: PluralCategory) => "two" | "few" | "other";
77
+ export const sq: (start: PluralCategory, end: PluralCategory) => "one" | "other";
78
+ export const sr: (start: PluralCategory, end: PluralCategory) => "one" | "few" | "other";
79
+ export const sv: (start: PluralCategory, end: PluralCategory) => "other";
80
+ export const sw: (start: PluralCategory, end: PluralCategory) => "one" | "other";
81
+ export const ta: (start: PluralCategory, end: PluralCategory) => "one" | "other";
82
+ export const te: (start: PluralCategory, end: PluralCategory) => "one" | "other";
83
+ export const th: (start: PluralCategory, end: PluralCategory) => "other";
84
+ export const tk: (start: PluralCategory, end: PluralCategory) => "one" | "other";
85
+ export const tr: (start: PluralCategory, end: PluralCategory) => "one" | "other";
86
+ export const ug: (start: PluralCategory, end: PluralCategory) => "one" | "other";
87
+ export const uk: (start: PluralCategory, end: PluralCategory) => "one" | "few" | "many" | "other";
88
+ export const ur: (start: PluralCategory, end: PluralCategory) => "other";
89
+ export const uz: (start: PluralCategory, end: PluralCategory) => "one" | "other";
90
+ export const vi: (start: PluralCategory, end: PluralCategory) => "other";
91
+ export const yue: (start: PluralCategory, end: PluralCategory) => "other";
92
+ export const zh: (start: PluralCategory, end: PluralCategory) => "other";
93
+ export const zu: (start: PluralCategory, end: PluralCategory) => "one" | "other";
package/ranges.js ADDED
@@ -0,0 +1,209 @@
1
+ const a = (start, end) => "other";
2
+ const b = (start, end) => (start === "other" && end === "one") ? "one" : "other";
3
+ const c = (start, end) => end || "other";
4
+
5
+ (function (root, pluralRanges) {
6
+ Object.defineProperty(pluralRanges, '__esModule', { value: true });
7
+ if (typeof define === 'function' && define.amd) define(pluralRanges);
8
+ else if (typeof exports === 'object') module.exports = pluralRanges;
9
+ else root.pluralRanges = pluralRanges;
10
+ }(this, {
11
+ af: a,
12
+
13
+ ak: b,
14
+
15
+ am: c,
16
+
17
+ an: a,
18
+
19
+ ar: (start, end) => (
20
+ end === "few" ? "few"
21
+ : end === "many" ? "many"
22
+ : (start === "zero" && end === "one") ? "zero"
23
+ : (start === "zero" && end === "two") ? "zero"
24
+ : "other"
25
+ ),
26
+
27
+ as: c,
28
+
29
+ az: c,
30
+
31
+ be: c,
32
+
33
+ bg: a,
34
+
35
+ bn: c,
36
+
37
+ bs: c,
38
+
39
+ ca: a,
40
+
41
+ cs: c,
42
+
43
+ cy: c,
44
+
45
+ da: c,
46
+
47
+ de: c,
48
+
49
+ el: c,
50
+
51
+ en: a,
52
+
53
+ es: a,
54
+
55
+ et: a,
56
+
57
+ eu: a,
58
+
59
+ fa: b,
60
+
61
+ fi: a,
62
+
63
+ fil: c,
64
+
65
+ fr: c,
66
+
67
+ ga: c,
68
+
69
+ gl: c,
70
+
71
+ gsw: c,
72
+
73
+ gu: c,
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
+ ),
82
+
83
+ hi: c,
84
+
85
+ hr: c,
86
+
87
+ hu: c,
88
+
89
+ hy: c,
90
+
91
+ ia: a,
92
+
93
+ id: a,
94
+
95
+ io: a,
96
+
97
+ is: c,
98
+
99
+ it: c,
100
+
101
+ ja: a,
102
+
103
+ ka: (start, end) => start || "other",
104
+
105
+ kk: c,
106
+
107
+ km: a,
108
+
109
+ kn: c,
110
+
111
+ ko: a,
112
+
113
+ ky: c,
114
+
115
+ lij: c,
116
+
117
+ lo: a,
118
+
119
+ lt: c,
120
+
121
+ lv: (start, end) => end === "one" ? "one" : "other",
122
+
123
+ mk: a,
124
+
125
+ ml: c,
126
+
127
+ mn: c,
128
+
129
+ mr: c,
130
+
131
+ ms: a,
132
+
133
+ my: a,
134
+
135
+ nb: a,
136
+
137
+ ne: c,
138
+
139
+ nl: c,
140
+
141
+ no: a,
142
+
143
+ or: b,
144
+
145
+ pa: c,
146
+
147
+ pcm: a,
148
+
149
+ pl: c,
150
+
151
+ ps: c,
152
+
153
+ pt: c,
154
+
155
+ ro: (start, end) => end === "few" ? "few" : end === "one" ? "few" : "other",
156
+
157
+ ru: c,
158
+
159
+ sc: c,
160
+
161
+ scn: c,
162
+
163
+ sd: b,
164
+
165
+ si: (start, end) => (start === "one" && end === "one") ? "one" : "other",
166
+
167
+ sk: c,
168
+
169
+ sl: (start, end) => (
170
+ end === "few" ? "few"
171
+ : end === "one" ? "few"
172
+ : end === "two" ? "two"
173
+ : "other"
174
+ ),
175
+
176
+ sq: c,
177
+
178
+ sr: c,
179
+
180
+ sv: a,
181
+
182
+ sw: c,
183
+
184
+ ta: c,
185
+
186
+ te: c,
187
+
188
+ th: a,
189
+
190
+ tk: c,
191
+
192
+ tr: c,
193
+
194
+ ug: c,
195
+
196
+ uk: c,
197
+
198
+ ur: a,
199
+
200
+ uz: c,
201
+
202
+ vi: a,
203
+
204
+ yue: a,
205
+
206
+ zh: a,
207
+
208
+ zu: c
209
+ }));
package/ranges.mjs ADDED
@@ -0,0 +1,112 @@
1
+ const a = (start, end) => "other";
2
+ const b = (start, end) => (start === "other" && end === "one") ? "one" : "other";
3
+ const c = (start, end) => end || "other";
4
+
5
+ export const af = a;
6
+ export const ak = b;
7
+ export const am = c;
8
+ export const an = a;
9
+ export const ar = (start, end) => (
10
+ end === "few" ? "few"
11
+ : end === "many" ? "many"
12
+ : (start === "zero" && end === "one") ? "zero"
13
+ : (start === "zero" && end === "two") ? "zero"
14
+ : "other"
15
+ );
16
+ export const as = c;
17
+ export const az = c;
18
+ export const be = c;
19
+ export const bg = a;
20
+ export const bn = c;
21
+ export const bs = c;
22
+ export const ca = a;
23
+ export const cs = c;
24
+ export const cy = c;
25
+ export const da = c;
26
+ export const de = c;
27
+ export const el = c;
28
+ export const en = a;
29
+ export const es = a;
30
+ export const et = a;
31
+ export const eu = a;
32
+ export const fa = b;
33
+ export const fi = a;
34
+ export const fil = c;
35
+ export const fr = c;
36
+ export const ga = c;
37
+ export const gl = c;
38
+ export const gsw = c;
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
+ );
47
+ export const hi = c;
48
+ export const hr = c;
49
+ export const hu = c;
50
+ export const hy = c;
51
+ export const ia = a;
52
+ export const id = a;
53
+ export const io = a;
54
+ export const is = c;
55
+ export const it = c;
56
+ export const ja = a;
57
+ export const ka = (start, end) => start || "other";
58
+ export const kk = c;
59
+ export const km = a;
60
+ export const kn = c;
61
+ export const ko = a;
62
+ export const ky = c;
63
+ export const lij = c;
64
+ export const lo = a;
65
+ export const lt = c;
66
+ export const lv = (start, end) => end === "one" ? "one" : "other";
67
+ export const mk = a;
68
+ export const ml = c;
69
+ export const mn = c;
70
+ export const mr = c;
71
+ export const ms = a;
72
+ export const my = a;
73
+ export const nb = a;
74
+ export const ne = c;
75
+ export const nl = c;
76
+ export const no = a;
77
+ export const or = b;
78
+ export const pa = c;
79
+ export const pcm = a;
80
+ export const pl = c;
81
+ export const ps = c;
82
+ export const pt = c;
83
+ export const ro = (start, end) => end === "few" ? "few" : end === "one" ? "few" : "other";
84
+ export const ru = c;
85
+ export const sc = c;
86
+ export const scn = c;
87
+ export const sd = b;
88
+ export const si = (start, end) => (start === "one" && end === "one") ? "one" : "other";
89
+ export const sk = c;
90
+ export const sl = (start, end) => (
91
+ end === "few" ? "few"
92
+ : end === "one" ? "few"
93
+ : end === "two" ? "two"
94
+ : "other"
95
+ );
96
+ export const sq = c;
97
+ export const sr = c;
98
+ export const sv = a;
99
+ export const sw = c;
100
+ export const ta = c;
101
+ export const te = c;
102
+ export const th = a;
103
+ export const tk = c;
104
+ export const tr = c;
105
+ export const ug = c;
106
+ export const uk = c;
107
+ export const ur = a;
108
+ export const uz = c;
109
+ export const vi = a;
110
+ export const yue = a;
111
+ export const zh = a;
112
+ export const zu = c;
package/CHANGELOG.md DELETED
@@ -1,91 +0,0 @@
1
- # Change Log
2
-
3
- All notable changes to this project will be documented in this file.
4
- See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
-
6
- # [6.2.0](https://github.com/eemeli/make-plural/compare/make-plural@6.1.0...make-plural@6.2.0) (2020-04-05)
7
-
8
-
9
- ### Features
10
-
11
- * Add d.ts typings for pluralCategories ([ae7472e](https://github.com/eemeli/make-plural/commit/ae7472eb12ecdb9768197faddf0be409eb2ced55))
12
- * Add d.ts typings for plurals ([db6e4b5](https://github.com/eemeli/make-plural/commit/db6e4b5d39994d159695ac113bdc5e005921a2f7))
13
- * Include type PluralCategory in all d.ts files ([9b368fc](https://github.com/eemeli/make-plural/commit/9b368fc5adafb6dc95c4bf7973a494edcab9a9f8))
14
-
15
-
16
-
17
-
18
-
19
- # [6.1.0](https://github.com/eemeli/make-plural/compare/make-plural@6.0.1...make-plural@6.1.0) (2020-03-08)
20
-
21
-
22
- ### Bug Fixes
23
-
24
- * Always set __esModule in UMD builds (eemeli/intl-pluralrules[#15](https://github.com/eemeli/make-plural/issues/15)) ([57d90bc](https://github.com/eemeli/make-plural/commit/57d90bcab45ad6439509a144aaeb493e5e0ef7dd))
25
-
26
-
27
- ### Features
28
-
29
- * **compiler:** Drop line folding & unnecessary (wrapping) ([c5d31f6](https://github.com/eemeli/make-plural/commit/c5d31f69d6f1032e291cb911cae8cc34b20099ed))
30
-
31
-
32
-
33
-
34
-
35
- ## [6.0.1](https://github.com/eemeli/make-plural/compare/make-plural@6.0.0...make-plural@6.0.1) (2019-10-18)
36
-
37
-
38
- ### Bug Fixes
39
-
40
- * Include __esModule: true in CommonJS export (eemeli/intl-pluralrules[#12](https://github.com/eemeli/make-plural/issues/12)) ([70daa3d](https://github.com/eemeli/make-plural/commit/70daa3df0d985b2d4b4fd9d6cf8659a5f58a79f4))
41
-
42
-
43
-
44
-
45
-
46
- # [6.0.0](https://github.com/eemeli/make-plural/compare/make-plural@6.0.0-beta.3...make-plural@6.0.0) (2019-10-17)
47
-
48
-
49
- ### BREAKING CHANGES
50
-
51
- * This drops the default export of the ES6 module, and for the UMD module renames "pt-PT" as pt_PT & "in" as _in.
52
- * This drops the umd/ and es6/ directories, in favour of serving the plurals and pluralCategories files from the package root. They are now distinguished by extension: .mjs for ES6 modules, and .js for UMD packaging.
53
-
54
-
55
- ### Features
56
-
57
- * Automate common-categories detection ([3421285](https://github.com/eemeli/make-plural/commit/3421285))
58
- * Automate common-plurals detection ([a6838a1](https://github.com/eemeli/make-plural/commit/a6838a1))
59
- * Improve category printing, including vars for strings ([9c0a8d8](https://github.com/eemeli/make-plural/commit/9c0a8d8))
60
- * Account for aliased locale codes ([f538772](https://github.com/eemeli/make-plural/commit/f538772))
61
- * Harmonise ES6 & UMD exports ([c24b666](https://github.com/eemeli/make-plural/commit/c24b666))
62
- * Change output paths ([3b4c7e9](https://github.com/eemeli/make-plural/commit/3b4c7e9))
63
- * Add named exports to ES6 modules, for tree-shaking ([37021e6](https://github.com/eemeli/make-plural/commit/37021e6))
64
- * Include separate exports for cardinals & ordinals ([ea23050](https://github.com/eemeli/make-plural/commit/ea23050))
65
- * Update cldr-core from 34 to 36 ([a9d2547](https://github.com/eemeli/make-plural/commit/a9d25474efde9b415dd5e4e63b825bcad06f7b07))
66
-
67
-
68
- ### Bug Fixes
69
-
70
- * Update for CLI changes ([9d151d0](https://github.com/eemeli/make-plural/commit/9d151d0))
71
- * Oops, add missing files to release ([d4f3050](https://github.com/eemeli/make-plural/commit/d4f3050))
72
-
73
-
74
-
75
- # [5.0.0](https://github.com/eemeli/make-plural/compare/9cbae0d...make-plural@5.0.0) (2019-07-15)
76
-
77
-
78
- ### BREAKING CHANGES
79
-
80
- * Split `make-plural-compiler` and `make-plural-cli` into their own packages
81
- * Move the `make-plural/make-plural` endpoint to `make-plural-compiler`
82
- * Move the `make-plural` binary to `make-plural-cli`
83
- * Repackage as monorepo, using Lerna ([671781d](https://github.com/eemeli/make-plural/commit/671781d))
84
- * Drop Bower support ([08f6668](https://github.com/eemeli/make-plural/commit/08f6668))
85
-
86
-
87
- ### Features
88
-
89
- * Include compiled plurals & plural categories in git repo ([eeca17a](https://github.com/eemeli/make-plural/commit/eeca17a))
90
- * **cli:** Refactor references to common plurals/categories when printing module ([ecb5bf9](https://github.com/eemeli/make-plural/commit/ecb5bf9))
91
- * **cli:** Use non-anonymous functions in module export ([5316a1a](https://github.com/eemeli/make-plural/commit/5316a1a))