@bgord/ui 0.8.8 → 0.8.9
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/dist/services/pluralize.js +15 -13
- package/package.json +8 -8
|
@@ -5,19 +5,21 @@ var PluralizationSupportedLanguages;
|
|
|
5
5
|
PluralizationSupportedLanguages["pl"] = "pl";
|
|
6
6
|
})(PluralizationSupportedLanguages || (PluralizationSupportedLanguages = {}));
|
|
7
7
|
export function pluralize(options) {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
switch (options.language) {
|
|
9
|
+
case PluralizationSupportedLanguages.en: {
|
|
10
|
+
if (options.value === 1)
|
|
11
|
+
return options.singular;
|
|
12
|
+
return options.plural ?? `${options.singular}s`;
|
|
13
|
+
}
|
|
14
|
+
case PluralizationSupportedLanguages.pl: {
|
|
15
|
+
if (options.value === 1)
|
|
16
|
+
return options.singular;
|
|
17
|
+
return polishPlurals(options.singular, String(options.plural), String(options.genitive), options.value ?? 1);
|
|
18
|
+
}
|
|
19
|
+
default: {
|
|
20
|
+
// biome-ignore lint: lint/suspicious/noConsole
|
|
21
|
+
console.warn(`[@bgord/ui] missing pluralization function for language: ${options.language}.`);
|
|
11
22
|
return options.singular;
|
|
12
|
-
|
|
23
|
+
}
|
|
13
24
|
}
|
|
14
|
-
if (options.language === PluralizationSupportedLanguages.pl) {
|
|
15
|
-
const value = options.value ?? 1;
|
|
16
|
-
if (value === 1)
|
|
17
|
-
return options.singular;
|
|
18
|
-
return polishPlurals(options.singular, String(options.plural), String(options.genitive), value);
|
|
19
|
-
}
|
|
20
|
-
// biome-ignore lint: lint/suspicious/noConsole
|
|
21
|
-
console.warn(`[@bgord/frontend] missing pluralization function for language: ${options.language}.`);
|
|
22
|
-
return options.singular;
|
|
23
25
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bgord/ui",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.9",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -23,22 +23,22 @@
|
|
|
23
23
|
"access": "public"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"@biomejs/biome": "2.3.
|
|
26
|
+
"@biomejs/biome": "2.3.8",
|
|
27
27
|
"@commitlint/cli": "20.1.0",
|
|
28
28
|
"@commitlint/config-conventional": "20.0.0",
|
|
29
|
-
"@happy-dom/global-registrator": "20.0.
|
|
29
|
+
"@happy-dom/global-registrator": "20.0.11",
|
|
30
30
|
"@testing-library/dom": "10.4.1",
|
|
31
31
|
"@testing-library/jest-dom": "6.9.1",
|
|
32
32
|
"@testing-library/react": "16.3.0",
|
|
33
33
|
"@testing-library/user-event": "14.6.1",
|
|
34
|
-
"@types/bun": "1.3.
|
|
34
|
+
"@types/bun": "1.3.3",
|
|
35
35
|
"@types/js-cookie": "3.0.6",
|
|
36
|
-
"@types/react": "19.2.
|
|
36
|
+
"@types/react": "19.2.7",
|
|
37
37
|
"@types/react-dom": "19.2.3",
|
|
38
|
-
"cspell": "9.3.
|
|
39
|
-
"knip": "5.
|
|
38
|
+
"cspell": "9.3.2",
|
|
39
|
+
"knip": "5.71.0",
|
|
40
40
|
"lefthook": "2.0.4",
|
|
41
|
-
"only-allow": "1.2.
|
|
41
|
+
"only-allow": "1.2.2",
|
|
42
42
|
"shellcheck": "4.1.0"
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|