@bccampus/utils 0.2.3 → 0.3.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/README.md +3 -8
- package/dist/array/chunk.cjs +13 -5
- package/dist/array/chunk.d.ts +7 -0
- package/dist/array/chunk.js +14 -7
- package/dist/array/chunk.test.d.ts +1 -0
- package/dist/date/iso-date-time/constants.cjs +27 -0
- package/dist/date/iso-date-time/constants.d.ts +9 -0
- package/dist/date/iso-date-time/constants.js +19 -0
- package/dist/date/iso-date-time/index.cjs +8 -0
- package/dist/date/iso-date-time/index.d.ts +5 -0
- package/dist/date/iso-date-time/index.js +3 -0
- package/dist/date/iso-date-time/iso-date-time.arithmetic.test.d.ts +1 -0
- package/dist/date/iso-date-time/iso-date-time.cjs +232 -0
- package/dist/date/{iso-date-time.d.ts → iso-date-time/iso-date-time.d.ts} +3 -32
- package/dist/date/iso-date-time/iso-date-time.format.test.d.ts +1 -0
- package/dist/date/iso-date-time/iso-date-time.js +231 -0
- package/dist/date/iso-date-time/iso-date-time.test.d.ts +1 -0
- package/dist/date/iso-date-time/types.cjs +0 -0
- package/dist/date/iso-date-time/types.d.ts +25 -0
- package/dist/date/iso-date-time/types.js +0 -0
- package/dist/duration/add-durations.cjs +5 -8
- package/dist/duration/add-durations.js +5 -9
- package/dist/duration/duration.test.d.ts +1 -0
- package/dist/duration/is-duration.cjs +4 -3
- package/dist/duration/is-duration.js +5 -5
- package/dist/duration/to-number.cjs +11 -10
- package/dist/duration/to-number.d.ts +1 -1
- package/dist/duration/to-number.js +11 -11
- package/dist/format/formatter.cjs +31 -31
- package/dist/format/formatter.d.ts +4 -4
- package/dist/format/formatter.js +32 -37
- package/dist/format/formatter.test.d.ts +1 -0
- package/dist/format/stringfy.test.d.ts +1 -0
- package/dist/format/stringify.cjs +34 -40
- package/dist/format/stringify.d.ts +1 -1
- package/dist/format/stringify.js +35 -42
- package/dist/format/template.cjs +25 -32
- package/dist/format/template.d.ts +3 -3
- package/dist/format/template.js +24 -33
- package/dist/format/template.test.d.ts +1 -0
- package/dist/index.cjs +0 -1
- package/dist/index.js +0 -1
- package/dist/object/get.cjs +5 -5
- package/dist/object/get.d.ts +1 -1
- package/dist/object/get.js +6 -7
- package/dist/object/get.test.d.ts +1 -0
- package/dist/object/is-object.cjs +5 -2
- package/dist/object/is-object.d.ts +1 -1
- package/dist/object/is-object.js +6 -4
- package/dist/object/is-object.test.d.ts +1 -0
- package/dist/object/omit.cjs +14 -16
- package/dist/object/omit.d.ts +1 -1
- package/dist/object/omit.js +15 -18
- package/dist/object/omit.test.d.ts +1 -0
- package/dist/object/pick.cjs +10 -9
- package/dist/object/pick.d.ts +1 -1
- package/dist/object/pick.js +9 -9
- package/dist/object/pick.test.d.ts +1 -0
- package/dist/object/set.cjs +13 -12
- package/dist/object/set.d.ts +1 -1
- package/dist/object/set.js +14 -14
- package/dist/object/set.test.d.ts +1 -0
- package/dist/path/file-url-to-path.cjs +10 -6
- package/dist/path/file-url-to-path.js +11 -8
- package/dist/path/file-url-to-path.test.d.ts +1 -0
- package/dist/path/normalize.cjs +41 -27
- package/dist/path/normalize.d.ts +8 -2
- package/dist/path/normalize.js +41 -28
- package/dist/path/normalize.test.d.ts +1 -0
- package/dist/set/difference.cjs +5 -6
- package/dist/set/difference.d.ts +1 -1
- package/dist/set/difference.js +6 -8
- package/dist/set/intersection.cjs +6 -9
- package/dist/set/intersection.d.ts +1 -1
- package/dist/set/intersection.js +7 -11
- package/dist/set/is-superset.cjs +5 -8
- package/dist/set/is-superset.d.ts +1 -1
- package/dist/set/is-superset.js +6 -10
- package/dist/set/set.test.d.ts +1 -0
- package/dist/set/symmetric-difference.cjs +6 -10
- package/dist/set/symmetric-difference.d.ts +1 -1
- package/dist/set/symmetric-difference.js +7 -12
- package/dist/set/union.cjs +5 -6
- package/dist/set/union.d.ts +1 -1
- package/dist/set/union.js +6 -8
- package/dist/string/capitalize.cjs +5 -2
- package/dist/string/capitalize.d.ts +1 -1
- package/dist/string/capitalize.js +6 -4
- package/dist/string/capitalize.test.d.ts +1 -0
- package/dist/string/normalize.cjs +7 -2
- package/dist/string/normalize.js +8 -4
- package/dist/string/normalize.test.d.ts +1 -0
- package/dist/string/pluralize/index.cjs +5 -4
- package/dist/string/pluralize/index.js +4 -5
- package/dist/string/pluralize/pluralize.cjs +162 -208
- package/dist/string/pluralize/pluralize.d.ts +4 -8
- package/dist/string/pluralize/pluralize.js +158 -205
- package/dist/string/pluralize/pluralize.test.d.ts +1 -0
- package/dist/string/pluralize/rules/index.cjs +8 -9
- package/dist/string/pluralize/rules/index.js +1 -6
- package/dist/string/pluralize/rules/irregular.cjs +55 -59
- package/dist/string/pluralize/rules/irregular.js +56 -61
- package/dist/string/pluralize/rules/pluralization.cjs +28 -36
- package/dist/string/pluralize/rules/pluralization.js +29 -38
- package/dist/string/pluralize/rules/singularization.cjs +27 -44
- package/dist/string/pluralize/rules/singularization.js +28 -46
- package/dist/string/pluralize/rules/uncountable.cjs +104 -110
- package/dist/string/pluralize/rules/uncountable.js +105 -112
- package/dist/string/pluralize/types.cjs +0 -1
- package/dist/string/pluralize/types.js +0 -1
- package/dist/string/slugify/index.cjs +2129 -2246
- package/dist/string/slugify/index.js +2130 -2248
- package/dist/string/slugify/slugify.test.d.ts +1 -0
- package/dist/string/strip-html-tags.cjs +4 -3
- package/dist/string/strip-html-tags.js +5 -5
- package/dist/string/strip-html-tags.test.d.ts +1 -0
- package/dist/string/to-int.cjs +14 -6
- package/dist/string/to-int.js +15 -8
- package/dist/string/to-int.test.d.ts +1 -0
- package/dist/string/to-sentence-case.cjs +6 -6
- package/dist/string/to-sentence-case.d.ts +1 -1
- package/dist/string/to-sentence-case.js +7 -8
- package/dist/string/to-sentence-case.test.d.ts +1 -0
- package/dist/string/trim.cjs +8 -7
- package/dist/string/trim.js +9 -9
- package/dist/string/trim.test.d.ts +1 -0
- package/dist/string/truncate.cjs +16 -15
- package/dist/string/truncate.js +17 -17
- package/dist/string/truncate.test.d.ts +1 -0
- package/dist/value/is-empty.cjs +30 -12
- package/dist/value/is-empty.d.ts +1 -1
- package/dist/value/is-empty.js +31 -14
- package/dist/value/value.test.d.ts +1 -0
- package/package.json +180 -69
- package/dist/array/index.cjs +0 -4
- package/dist/array/index.d.ts +0 -2
- package/dist/array/index.js +0 -4
- package/dist/date/index.cjs +0 -8
- package/dist/date/index.d.ts +0 -3
- package/dist/date/index.js +0 -8
- package/dist/date/iso-date-time.cjs +0 -256
- package/dist/date/iso-date-time.js +0 -256
- package/dist/duration/index.cjs +0 -8
- package/dist/duration/index.d.ts +0 -4
- package/dist/duration/index.js +0 -8
- package/dist/format/index.cjs +0 -13
- package/dist/format/index.d.ts +0 -5
- package/dist/format/index.js +0 -13
- package/dist/object/index.cjs +0 -12
- package/dist/object/index.d.ts +0 -6
- package/dist/object/index.js +0 -12
- package/dist/path/index.cjs +0 -6
- package/dist/path/index.d.ts +0 -4
- package/dist/path/index.js +0 -6
- package/dist/set/index.cjs +0 -12
- package/dist/set/index.d.ts +0 -6
- package/dist/set/index.js +0 -12
- package/dist/string/index.cjs +0 -14
- package/dist/string/index.d.ts +0 -8
- package/dist/string/index.js +0 -14
- package/dist/value/index.cjs +0 -4
- package/dist/value/index.d.ts +0 -2
- package/dist/value/index.js +0 -4
|
@@ -2,209 +2,162 @@ import { IRREGULAR_WORDS } from "./rules/irregular.js";
|
|
|
2
2
|
import { PLURALIZATION_RULES } from "./rules/pluralization.js";
|
|
3
3
|
import { SINGULARIZATION_RULES } from "./rules/singularization.js";
|
|
4
4
|
import { UNCOUNTABLE_WORDS } from "./rules/uncountable.js";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
}
|
|
162
|
-
return this.sanitizeWord(token, word, rules);
|
|
163
|
-
}
|
|
164
|
-
/**
|
|
165
|
-
* Check if a word is part of the map.
|
|
166
|
-
*/
|
|
167
|
-
checkWord(word, reason) {
|
|
168
|
-
const replaceMap = reason === "Plurality" ? this.irregularSingles : this.irregularPlurals;
|
|
169
|
-
const keepMap = reason === "Plurality" ? this.irregularPlurals : this.irregularSingles;
|
|
170
|
-
const rules = reason === "Singularity" ? this.pluralRules : this.singularRules;
|
|
171
|
-
const token = word.toLowerCase();
|
|
172
|
-
if (keepMap[token]) return true;
|
|
173
|
-
if (replaceMap[token]) return false;
|
|
174
|
-
return this.sanitizeWord(token, token, rules) === token;
|
|
175
|
-
}
|
|
176
|
-
/**
|
|
177
|
-
* Pluralize or singularize a word based on the passed in count.
|
|
178
|
-
*/
|
|
179
|
-
pluralize(word, count, inclusive) {
|
|
180
|
-
const pluralized = count === 1 ? this.singular(word) : this.plural(word);
|
|
181
|
-
return (inclusive ? `${count} ` : "") + pluralized;
|
|
182
|
-
}
|
|
183
|
-
/**
|
|
184
|
-
* Pluralize a word.
|
|
185
|
-
*/
|
|
186
|
-
plural(singularWord) {
|
|
187
|
-
return this.replaceWord(singularWord, "SingularToPlural");
|
|
188
|
-
}
|
|
189
|
-
/**
|
|
190
|
-
* Check if a word is plural.
|
|
191
|
-
*/
|
|
192
|
-
isPlural(word) {
|
|
193
|
-
this.checkWord(word, "Plurality");
|
|
194
|
-
}
|
|
195
|
-
/**
|
|
196
|
-
* Singularize a word.
|
|
197
|
-
*/
|
|
198
|
-
singular(pluralWord) {
|
|
199
|
-
return this.replaceWord(pluralWord, "PluralToSingular");
|
|
200
|
-
}
|
|
201
|
-
/**
|
|
202
|
-
* Check if a word is singular.
|
|
203
|
-
*/
|
|
204
|
-
isSingular(word) {
|
|
205
|
-
this.checkWord(word, "Singularity");
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
export {
|
|
209
|
-
Pluralize
|
|
5
|
+
//#region src/string/pluralize/pluralize.ts
|
|
6
|
+
var TagIndexRegExp = /\$(\d{1,2})/g;
|
|
7
|
+
var Pluralize = class {
|
|
8
|
+
pluralRules = [];
|
|
9
|
+
singularRules = [];
|
|
10
|
+
uncountables = {};
|
|
11
|
+
irregularPlurals = {};
|
|
12
|
+
irregularSingles = {};
|
|
13
|
+
constructor() {
|
|
14
|
+
for (let index = 0; index < IRREGULAR_WORDS.length; index += 1) this.addIrregularRule(IRREGULAR_WORDS[index][0], IRREGULAR_WORDS[index][1]);
|
|
15
|
+
for (let index = 0; index < PLURALIZATION_RULES.length; index += 1) this.addPluralRule(PLURALIZATION_RULES[index][0], PLURALIZATION_RULES[index][1]);
|
|
16
|
+
for (let index = 0; index < SINGULARIZATION_RULES.length; index += 1) this.addSingularRule(SINGULARIZATION_RULES[index][0], SINGULARIZATION_RULES[index][1]);
|
|
17
|
+
for (let index = 0; index < UNCOUNTABLE_WORDS.length; index += 1) this.addUncountableRule(UNCOUNTABLE_WORDS[index]);
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Add a pluralization rule to the collection.
|
|
21
|
+
*/
|
|
22
|
+
addPluralRule(rule, replacement) {
|
|
23
|
+
this.pluralRules.push([this.sanitizeRule(rule), replacement]);
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Add a singularization rule to the collection.
|
|
27
|
+
*/
|
|
28
|
+
addSingularRule(rule, replacement) {
|
|
29
|
+
this.singularRules.push([this.sanitizeRule(rule), replacement]);
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Add an uncountable word rule.
|
|
33
|
+
*/
|
|
34
|
+
addUncountableRule(word) {
|
|
35
|
+
if (typeof word === "string") {
|
|
36
|
+
this.uncountables[word.toLowerCase()] = true;
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
this.addPluralRule(word, "$0");
|
|
40
|
+
this.addSingularRule(word, "$0");
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Add an irregular word definition.
|
|
44
|
+
*
|
|
45
|
+
* @param {string} single
|
|
46
|
+
* @param {string} plural
|
|
47
|
+
*/
|
|
48
|
+
addIrregularRule(single, plural) {
|
|
49
|
+
plural = plural.toLowerCase();
|
|
50
|
+
single = single.toLowerCase();
|
|
51
|
+
this.irregularSingles[single] = plural;
|
|
52
|
+
this.irregularPlurals[plural] = single;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Sanitize a pluralization rule to a usable regular expression.
|
|
56
|
+
*/
|
|
57
|
+
sanitizeRule(rule) {
|
|
58
|
+
if (typeof rule === "string") return new RegExp(`^${rule}$`, "i");
|
|
59
|
+
return rule;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Pass in a word token to produce a function that can replicate the case on
|
|
63
|
+
* another word.
|
|
64
|
+
*/
|
|
65
|
+
restoreCase(word, token) {
|
|
66
|
+
if (word === token) return token;
|
|
67
|
+
if (word === word.toUpperCase()) return token.toUpperCase();
|
|
68
|
+
if (word[0] === word[0].toUpperCase()) return token.charAt(0).toUpperCase() + token.substring(1).toLowerCase();
|
|
69
|
+
return token.toLowerCase();
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Interpolate a regexp string.
|
|
73
|
+
*
|
|
74
|
+
* @param {string} str
|
|
75
|
+
* @param {Array} args
|
|
76
|
+
* @return {string}
|
|
77
|
+
*/
|
|
78
|
+
interpolate(str, args) {
|
|
79
|
+
return str.replace(TagIndexRegExp, (match, index) => {
|
|
80
|
+
return args[index] || "";
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Replace a word using a rule.
|
|
85
|
+
*/
|
|
86
|
+
replace(word, rule) {
|
|
87
|
+
return word.replace(rule[0], (...args) => {
|
|
88
|
+
const [match, index] = args;
|
|
89
|
+
const result = this.interpolate(rule[1], args);
|
|
90
|
+
if (match === "") return this.restoreCase(word[index - 1], result);
|
|
91
|
+
return this.restoreCase(match, result);
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Sanitize a word by passing in the word and sanitization rules.
|
|
96
|
+
*/
|
|
97
|
+
sanitizeWord(token, word, rules) {
|
|
98
|
+
if (!token.length || this.uncountables[token]) return word;
|
|
99
|
+
let len = rules.length;
|
|
100
|
+
while (len--) {
|
|
101
|
+
const rule = rules[len];
|
|
102
|
+
if (typeof rule[0] === "string" || rule[0].test(word)) return this.replace(word, rule);
|
|
103
|
+
}
|
|
104
|
+
return word;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Replace a word with the updated word.
|
|
108
|
+
*/
|
|
109
|
+
replaceWord(word, direction) {
|
|
110
|
+
const replaceMap = direction === "SingularToPlural" ? this.irregularSingles : this.irregularPlurals;
|
|
111
|
+
const keepMap = direction === "SingularToPlural" ? this.irregularPlurals : this.irregularSingles;
|
|
112
|
+
const rules = direction === "SingularToPlural" ? this.pluralRules : this.singularRules;
|
|
113
|
+
const token = word.toLowerCase();
|
|
114
|
+
if (keepMap[token]) return this.restoreCase(word, token);
|
|
115
|
+
if (replaceMap[token]) return this.restoreCase(word, replaceMap[token]);
|
|
116
|
+
return this.sanitizeWord(token, word, rules);
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* Check if a word is part of the map.
|
|
120
|
+
*/
|
|
121
|
+
checkWord(word, reason) {
|
|
122
|
+
const replaceMap = reason === "Plurality" ? this.irregularSingles : this.irregularPlurals;
|
|
123
|
+
const keepMap = reason === "Plurality" ? this.irregularPlurals : this.irregularSingles;
|
|
124
|
+
const rules = reason === "Plurality" ? this.pluralRules : this.singularRules;
|
|
125
|
+
const token = word.toLowerCase();
|
|
126
|
+
if (keepMap[token]) return true;
|
|
127
|
+
if (replaceMap[token]) return false;
|
|
128
|
+
return this.sanitizeWord(token, token, rules) === token;
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Pluralize or singularize a word based on the passed in count.
|
|
132
|
+
*/
|
|
133
|
+
pluralize(word, count, inclusive = false) {
|
|
134
|
+
const pluralized = count === 1 ? this.singular(word) : this.plural(word);
|
|
135
|
+
return (inclusive ? `${count} ` : "") + pluralized;
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Pluralize a word.
|
|
139
|
+
*/
|
|
140
|
+
plural(singularWord) {
|
|
141
|
+
return this.replaceWord(singularWord, "SingularToPlural");
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* Check if a word is plural.
|
|
145
|
+
*/
|
|
146
|
+
isPlural(word) {
|
|
147
|
+
return this.checkWord(word, "Plurality");
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* Singularize a word.
|
|
151
|
+
*/
|
|
152
|
+
singular(pluralWord) {
|
|
153
|
+
return this.replaceWord(pluralWord, "PluralToSingular");
|
|
154
|
+
}
|
|
155
|
+
/**
|
|
156
|
+
* Check if a word is singular.
|
|
157
|
+
*/
|
|
158
|
+
isSingular(word) {
|
|
159
|
+
return this.checkWord(word, "Singularity");
|
|
160
|
+
}
|
|
210
161
|
};
|
|
162
|
+
//#endregion
|
|
163
|
+
export { Pluralize };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
exports.IRREGULAR_WORDS =
|
|
8
|
-
exports.PLURALIZATION_RULES =
|
|
9
|
-
exports.SINGULARIZATION_RULES =
|
|
10
|
-
exports.UNCOUNTABLE_WORDS =
|
|
2
|
+
const require_string_pluralize_rules_irregular = require("./irregular.cjs");
|
|
3
|
+
const require_string_pluralize_rules_pluralization = require("./pluralization.cjs");
|
|
4
|
+
const require_string_pluralize_rules_singularization = require("./singularization.cjs");
|
|
5
|
+
const require_string_pluralize_rules_uncountable = require("./uncountable.cjs");
|
|
6
|
+
exports.IRREGULAR_WORDS = require_string_pluralize_rules_irregular.IRREGULAR_WORDS;
|
|
7
|
+
exports.PLURALIZATION_RULES = require_string_pluralize_rules_pluralization.PLURALIZATION_RULES;
|
|
8
|
+
exports.SINGULARIZATION_RULES = require_string_pluralize_rules_singularization.SINGULARIZATION_RULES;
|
|
9
|
+
exports.UNCOUNTABLE_WORDS = require_string_pluralize_rules_uncountable.UNCOUNTABLE_WORDS;
|
|
@@ -2,9 +2,4 @@ import { IRREGULAR_WORDS } from "./irregular.js";
|
|
|
2
2
|
import { PLURALIZATION_RULES } from "./pluralization.js";
|
|
3
3
|
import { SINGULARIZATION_RULES } from "./singularization.js";
|
|
4
4
|
import { UNCOUNTABLE_WORDS } from "./uncountable.js";
|
|
5
|
-
export {
|
|
6
|
-
IRREGULAR_WORDS,
|
|
7
|
-
PLURALIZATION_RULES,
|
|
8
|
-
SINGULARIZATION_RULES,
|
|
9
|
-
UNCOUNTABLE_WORDS
|
|
10
|
-
};
|
|
5
|
+
export { IRREGULAR_WORDS, PLURALIZATION_RULES, SINGULARIZATION_RULES, UNCOUNTABLE_WORDS };
|
|
@@ -1,62 +1,58 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
["groove", "grooves"],
|
|
58
|
-
["pickaxe", "pickaxes"],
|
|
59
|
-
["passerby", "passersby"],
|
|
60
|
-
["canvas", "canvases"]
|
|
2
|
+
//#region src/string/pluralize/rules/irregular.ts
|
|
3
|
+
var IRREGULAR_WORDS = [
|
|
4
|
+
["I", "we"],
|
|
5
|
+
["me", "us"],
|
|
6
|
+
["he", "they"],
|
|
7
|
+
["she", "they"],
|
|
8
|
+
["them", "them"],
|
|
9
|
+
["myself", "ourselves"],
|
|
10
|
+
["yourself", "yourselves"],
|
|
11
|
+
["itself", "themselves"],
|
|
12
|
+
["herself", "themselves"],
|
|
13
|
+
["himself", "themselves"],
|
|
14
|
+
["themself", "themselves"],
|
|
15
|
+
["is", "are"],
|
|
16
|
+
["was", "were"],
|
|
17
|
+
["has", "have"],
|
|
18
|
+
["this", "these"],
|
|
19
|
+
["that", "those"],
|
|
20
|
+
["my", "our"],
|
|
21
|
+
["its", "their"],
|
|
22
|
+
["his", "their"],
|
|
23
|
+
["her", "their"],
|
|
24
|
+
["echo", "echoes"],
|
|
25
|
+
["dingo", "dingoes"],
|
|
26
|
+
["volcano", "volcanoes"],
|
|
27
|
+
["tornado", "tornadoes"],
|
|
28
|
+
["torpedo", "torpedoes"],
|
|
29
|
+
["genus", "genera"],
|
|
30
|
+
["viscus", "viscera"],
|
|
31
|
+
["stigma", "stigmata"],
|
|
32
|
+
["stoma", "stomata"],
|
|
33
|
+
["dogma", "dogmata"],
|
|
34
|
+
["lemma", "lemmata"],
|
|
35
|
+
["schema", "schemata"],
|
|
36
|
+
["anathema", "anathemata"],
|
|
37
|
+
["ox", "oxen"],
|
|
38
|
+
["axe", "axes"],
|
|
39
|
+
["die", "dice"],
|
|
40
|
+
["yes", "yeses"],
|
|
41
|
+
["foot", "feet"],
|
|
42
|
+
["eave", "eaves"],
|
|
43
|
+
["goose", "geese"],
|
|
44
|
+
["tooth", "teeth"],
|
|
45
|
+
["quiz", "quizzes"],
|
|
46
|
+
["human", "humans"],
|
|
47
|
+
["proof", "proofs"],
|
|
48
|
+
["carve", "carves"],
|
|
49
|
+
["valve", "valves"],
|
|
50
|
+
["looey", "looies"],
|
|
51
|
+
["thief", "thieves"],
|
|
52
|
+
["groove", "grooves"],
|
|
53
|
+
["pickaxe", "pickaxes"],
|
|
54
|
+
["passerby", "passersby"],
|
|
55
|
+
["canvas", "canvases"]
|
|
61
56
|
];
|
|
57
|
+
//#endregion
|
|
62
58
|
exports.IRREGULAR_WORDS = IRREGULAR_WORDS;
|
|
@@ -1,62 +1,57 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
["groove", "grooves"],
|
|
56
|
-
["pickaxe", "pickaxes"],
|
|
57
|
-
["passerby", "passersby"],
|
|
58
|
-
["canvas", "canvases"]
|
|
1
|
+
//#region src/string/pluralize/rules/irregular.ts
|
|
2
|
+
var IRREGULAR_WORDS = [
|
|
3
|
+
["I", "we"],
|
|
4
|
+
["me", "us"],
|
|
5
|
+
["he", "they"],
|
|
6
|
+
["she", "they"],
|
|
7
|
+
["them", "them"],
|
|
8
|
+
["myself", "ourselves"],
|
|
9
|
+
["yourself", "yourselves"],
|
|
10
|
+
["itself", "themselves"],
|
|
11
|
+
["herself", "themselves"],
|
|
12
|
+
["himself", "themselves"],
|
|
13
|
+
["themself", "themselves"],
|
|
14
|
+
["is", "are"],
|
|
15
|
+
["was", "were"],
|
|
16
|
+
["has", "have"],
|
|
17
|
+
["this", "these"],
|
|
18
|
+
["that", "those"],
|
|
19
|
+
["my", "our"],
|
|
20
|
+
["its", "their"],
|
|
21
|
+
["his", "their"],
|
|
22
|
+
["her", "their"],
|
|
23
|
+
["echo", "echoes"],
|
|
24
|
+
["dingo", "dingoes"],
|
|
25
|
+
["volcano", "volcanoes"],
|
|
26
|
+
["tornado", "tornadoes"],
|
|
27
|
+
["torpedo", "torpedoes"],
|
|
28
|
+
["genus", "genera"],
|
|
29
|
+
["viscus", "viscera"],
|
|
30
|
+
["stigma", "stigmata"],
|
|
31
|
+
["stoma", "stomata"],
|
|
32
|
+
["dogma", "dogmata"],
|
|
33
|
+
["lemma", "lemmata"],
|
|
34
|
+
["schema", "schemata"],
|
|
35
|
+
["anathema", "anathemata"],
|
|
36
|
+
["ox", "oxen"],
|
|
37
|
+
["axe", "axes"],
|
|
38
|
+
["die", "dice"],
|
|
39
|
+
["yes", "yeses"],
|
|
40
|
+
["foot", "feet"],
|
|
41
|
+
["eave", "eaves"],
|
|
42
|
+
["goose", "geese"],
|
|
43
|
+
["tooth", "teeth"],
|
|
44
|
+
["quiz", "quizzes"],
|
|
45
|
+
["human", "humans"],
|
|
46
|
+
["proof", "proofs"],
|
|
47
|
+
["carve", "carves"],
|
|
48
|
+
["valve", "valves"],
|
|
49
|
+
["looey", "looies"],
|
|
50
|
+
["thief", "thieves"],
|
|
51
|
+
["groove", "grooves"],
|
|
52
|
+
["pickaxe", "pickaxes"],
|
|
53
|
+
["passerby", "passersby"],
|
|
54
|
+
["canvas", "canvases"]
|
|
59
55
|
];
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
};
|
|
56
|
+
//#endregion
|
|
57
|
+
export { IRREGULAR_WORDS };
|