@jjlmoya/utils-health 1.3.0 → 1.4.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": "@jjlmoya/utils-health",
3
- "version": "1.3.0",
3
+ "version": "1.4.0",
4
4
  "type": "module",
5
5
  "main": "./src/index.ts",
6
6
  "types": "./src/index.ts",
@@ -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, HowToThing, SoftwareApplication } from 'sche
2
2
  import type { ToolLocaleContent } from '../../../types';
3
3
  import type { BMICalculatorUI } from '../ui';
4
4
 
5
- const slug = 'bmi-calculator-nl';
5
+ const slug = 'bmi-rekenmachine';
6
6
  const title = 'BMI Calculator: Body Mass Index Online Berekenen';
7
7
  const description =
8
8
  'Bereken gratis je Body Mass Index (BMI). Online tool om je voedingstoestand te beoordelen op basis van gewicht en lengte, met visuele schaal en WHO-categorieën.';
@@ -2,7 +2,7 @@ import type { WithContext, SoftwareApplication, FAQPage, HowToThing } from 'sche
2
2
  import type { ToolLocaleContent } from '../../../types';
3
3
  import type { EpworthSleepinessScaleUI } from '../ui';
4
4
 
5
- const slug = 'epworth-sleepiness-scale-test-nl';
5
+ const slug = 'epworth-slaperigheidsschaal-test';
6
6
  const title = 'Epworth Sleepiness Scale Test';
7
7
  const description =
8
8
  'Meet uw slaperigheid overdag met de Epworth Sleepiness Scale. Een klinisch gevalideerde test om mogelijke slaapstoornissen op te sporen.';
@@ -2,7 +2,7 @@ import type { WithContext, SoftwareApplication, FAQPage, HowToThing } from 'sche
2
2
  import type { ToolLocaleContent } from '../../../types';
3
3
  import type { EpworthSleepinessScaleUI } from '../ui';
4
4
 
5
- const slug = 'epworth-sleepiness-scale-test-sv';
5
+ const slug = 'epworth-somnigas-skala-test';
6
6
  const title = 'Epworth Sleepiness Scale Test';
7
7
  const description =
8
8
  'Mät din dagtids sömnighet med Epworth Sleepiness Scale. Ett kliniskt validerat test för att upptäcka möjliga sömnstörningar.';