@dpuse/dpuse-shared 0.3.743 → 0.3.745
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
CHANGED
|
@@ -145,10 +145,10 @@ _Note: Sonda's Vite reports currently exclude CSS files, since Vite does not gen
|
|
|
145
145
|
| dist/componentConfig.schema-DzuoA1f0.js | 10.9 kB · brotli 2.3 kB |
|
|
146
146
|
| dist/dpuse-shared-encoding.es.js | 6.8 kB · brotli 953 B |
|
|
147
147
|
| dist/dpuse-shared-componentModuleConnector.es.js | 3.6 kB · brotli 1.2 kB |
|
|
148
|
-
| dist/dpuse-shared-utilities.es.js | 3.6 kB · brotli 1.
|
|
148
|
+
| dist/dpuse-shared-utilities.es.js | 3.6 kB · brotli 1.1 kB |
|
|
149
149
|
| dist/dpuse-shared-errors.es.js | 3.5 kB · brotli 1.1 kB |
|
|
150
150
|
| dist/dpuse-shared-component.es.js | 1.3 kB · brotli 458 B |
|
|
151
|
-
| dist/dpuse-shared-locale.es.js |
|
|
151
|
+
| dist/dpuse-shared-locale.es.js | 987 B · brotli 390 B |
|
|
152
152
|
| dist/dpuse-shared-componentDataView.es.js | 722 B · brotli 310 B |
|
|
153
153
|
| dist/dpuse-shared-componentModuleContext.es.js | 471 B · brotli 239 B |
|
|
154
154
|
| dist/dpuse-shared-componentModulePresenter.es.js | 411 B · brotli 226 B |
|
|
@@ -28,10 +28,17 @@ function i(e, t, n = !1) {
|
|
|
28
28
|
}));
|
|
29
29
|
return n ? r.toSorted((e, t) => e.label.localeCompare(t.label) || e.id.localeCompare(t.id)) : r;
|
|
30
30
|
}
|
|
31
|
-
function a(e, t
|
|
31
|
+
function a(e, t) {
|
|
32
|
+
return {
|
|
33
|
+
...e,
|
|
34
|
+
label: e.label[t] ?? e.id,
|
|
35
|
+
description: e.description[t]
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
function o(e, t, n = "en") {
|
|
32
39
|
let r = e.get(t);
|
|
33
40
|
if (r !== void 0) return r;
|
|
34
41
|
if (n !== t) return e.get(n);
|
|
35
42
|
}
|
|
36
43
|
//#endregion
|
|
37
|
-
export { e as DEFAULT_LOCALE_ID, t as SUPPORTED_LANGUAGES, n as createLabelMap, r as localiseConfig, i as localiseConfigs, a as resolveLabel };
|
|
44
|
+
export { e as DEFAULT_LOCALE_ID, t as SUPPORTED_LANGUAGES, n as createLabelMap, r as localiseConfig, i as localiseConfigs, a as localiseReference, o as resolveLabel };
|
|
@@ -14,6 +14,15 @@ interface UnlocalisedConfig {
|
|
|
14
14
|
description: LocaleDescription;
|
|
15
15
|
verb?: LocaleLabel | undefined;
|
|
16
16
|
}
|
|
17
|
+
export type LocalisedReference<T> = Omit<T, 'label' | 'description'> & {
|
|
18
|
+
label: string;
|
|
19
|
+
description: string[];
|
|
20
|
+
};
|
|
21
|
+
interface UnlocalisedReference {
|
|
22
|
+
id: string;
|
|
23
|
+
label: LocaleLabel;
|
|
24
|
+
description: LocaleDescription;
|
|
25
|
+
}
|
|
17
26
|
export declare const DEFAULT_LOCALE_ID: LocaleId;
|
|
18
27
|
export declare const SUPPORTED_LANGUAGES: {
|
|
19
28
|
id: LocaleId;
|
|
@@ -23,5 +32,6 @@ export declare const SUPPORTED_LANGUAGES: {
|
|
|
23
32
|
export declare function createLabelMap(labels: Record<string, string>): LocaleLabelMap;
|
|
24
33
|
export declare function localiseConfig<T extends UnlocalisedConfig>(config: T, localeId: LocaleId): LocalisedConfig<T>;
|
|
25
34
|
export declare function localiseConfigs<T extends UnlocalisedConfig>(configs: T[], localeId: LocaleId, isResultSorted?: boolean): LocalisedConfig<T>[];
|
|
35
|
+
export declare function localiseReference<T extends UnlocalisedReference>(reference: T, localeId: LocaleId): LocalisedReference<T>;
|
|
26
36
|
export declare function resolveLabel(labels: LocaleLabelMap, localeId: string, fallbackLocaleId?: LocaleId): string | undefined;
|
|
27
37
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dpuse/dpuse-shared",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.745",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Common constants, types and utilities used across all DPUse projects.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -139,7 +139,7 @@
|
|
|
139
139
|
"test": "node -e \"import('@dpuse/dpuse-development').then(m => m.testProject())\""
|
|
140
140
|
},
|
|
141
141
|
"devDependencies": {
|
|
142
|
-
"@dpuse/dpuse-development": "^0.3.
|
|
142
|
+
"@dpuse/dpuse-development": "^0.3.690",
|
|
143
143
|
"@dpuse/eslint-config-dpuse": "^1.0.113",
|
|
144
144
|
"@types/node": "^26.1.1",
|
|
145
145
|
"eslint": "^10.7.0",
|
|
@@ -148,7 +148,7 @@
|
|
|
148
148
|
"sonda": "^0.14.0",
|
|
149
149
|
"typescript": "^6.0.3",
|
|
150
150
|
"valibot": "^1.4.2",
|
|
151
|
-
"vite": "^8.1.
|
|
151
|
+
"vite": "^8.1.5",
|
|
152
152
|
"vite-plugin-dts": "^5.0.3",
|
|
153
153
|
"vitest": "^4.1.10"
|
|
154
154
|
}
|