@jjlmoya/utils-sports 1.4.0 → 1.6.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
package/src/index.ts
CHANGED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest';
|
|
2
|
+
import { ALL_TOOLS } from '../tools';
|
|
3
|
+
import type { ToolLocaleContent } from '../types';
|
|
4
|
+
|
|
5
|
+
describe('Slug Language Code Format Validation', () => {
|
|
6
|
+
ALL_TOOLS.forEach((tool) => {
|
|
7
|
+
describe(`Tool: ${tool.entry.id}`, () => {
|
|
8
|
+
it('slug should not end with 2-letter language codes like -ja, -ru, -ko', async () => {
|
|
9
|
+
const locales = Object.keys(tool.entry.i18n);
|
|
10
|
+
|
|
11
|
+
for (const locale of locales) {
|
|
12
|
+
const loader = tool.entry.i18n[locale as keyof typeof tool.entry.i18n];
|
|
13
|
+
const content = (await loader?.()) as ToolLocaleContent;
|
|
14
|
+
|
|
15
|
+
expect(
|
|
16
|
+
content.slug,
|
|
17
|
+
`Tool "${tool.entry.id}" locale "${locale}" slug ("${content.slug}") cannot end with a 2-letter language code (e.g., -ja, -ru, -ko).`,
|
|
18
|
+
).not.toMatch(/-[a-z]{2}$/);
|
|
19
|
+
}
|
|
20
|
+
});
|
|
21
|
+
});
|
|
22
|
+
});
|
|
23
|
+
});
|
|
@@ -2,7 +2,7 @@ import type { WithContext, FAQPage, HowTo, SoftwareApplication } from 'schema-dt
|
|
|
2
2
|
import type { ToolLocaleContent } from '../../../types';
|
|
3
3
|
import type { GymTrackerUI } from '../ui';
|
|
4
4
|
|
|
5
|
-
const slug = '
|
|
5
|
+
const slug = 'tracker-trenirovok';
|
|
6
6
|
const title = 'Трекер тренировок: Графики прогресса и дневник силы';
|
|
7
7
|
const description =
|
|
8
8
|
'Записывайте свои веса, выбирайте упражнения и визуализируйте свой прогресс с помощью графиков силы. Оптимизируйте прогрессивную перегрузку в тренажерном зале.';
|
|
@@ -2,7 +2,7 @@ import type { WithContext, FAQPage, HowTo, SoftwareApplication } from 'schema-dt
|
|
|
2
2
|
import type { ToolLocaleContent } from '../../../types';
|
|
3
3
|
import type { ReactionTesterUI } from '../ui';
|
|
4
4
|
|
|
5
|
-
const slug = '
|
|
5
|
+
const slug = 'reflextest-snabbhet';
|
|
6
6
|
const title = 'Reaktionstidtest (Reflexer): Online Benchmark';
|
|
7
7
|
const description = 'Mät dina reflexer i millisekunder med vårt professionella reaktionstest. Konkurrera om rankningar från \"Sköldpadda\" till \"Cyberatlet\" och analysera din prestation.';
|
|
8
8
|
|