@dpuse/dpuse-shared 0.3.670 → 0.3.671

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.
@@ -19,13 +19,14 @@ function r(e, t) {
19
19
  verb: e.verb?.[t] ?? void 0
20
20
  };
21
21
  }
22
- function i(e, t) {
23
- return console.log(111, e, t), e.map((e) => ({
22
+ function i(e, t, n = !1) {
23
+ let r = e.map((e) => ({
24
24
  ...e,
25
25
  label: e.label[t] ?? e.id,
26
26
  description: e.description[t] ?? e.id,
27
27
  verb: e.verb?.[t] ?? void 0
28
- })).toSorted((e, t) => e.label.localeCompare(t.label) || e.id.localeCompare(t.id));
28
+ }));
29
+ return n ? r.toSorted((e, t) => e.label.localeCompare(t.label) || e.id.localeCompare(t.id)) : r;
29
30
  }
30
31
  function a(e, t, n = "en") {
31
32
  let r = e.get(t);
@@ -21,6 +21,6 @@ export declare const SUPPORTED_LANGUAGES: {
21
21
  }[];
22
22
  export declare function createLabelMap(labels: Record<string, string>): LocaleLabelMap;
23
23
  export declare function localiseConfig<T extends UnlocalisedConfig>(config: T, localeId: LocaleId): LocalisedConfig<T>;
24
- export declare function localiseConfigs<T extends UnlocalisedConfig>(configs: T[], localeId: LocaleId): LocalisedConfig<T>[];
24
+ export declare function localiseConfigs<T extends UnlocalisedConfig>(configs: T[], localeId: LocaleId, sortResult?: boolean): LocalisedConfig<T>[];
25
25
  export declare function resolveLabel(labels: LocaleLabelMap, localeId: string, fallbackLocaleId?: LocaleId): string | undefined;
26
26
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dpuse/dpuse-shared",
3
- "version": "0.3.670",
3
+ "version": "0.3.671",
4
4
  "description": "Common constants, types and utilities used across all DPUse projects.",
5
5
  "license": "MIT",
6
6
  "author": "Jonathan Terrell <terrell.jm@gmail.com>",