bfg-common 1.3.583 → 1.3.584

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.
@@ -1,4 +1,5 @@
1
1
  import type { UI_I_Localization } from '~/lib/models/interfaces'
2
+ import type {UI_T_LanguageKey} from "~/lib/models/types";
2
3
 
3
4
  export function productNameLocal(
4
5
  localization: UI_I_Localization
@@ -14,19 +15,15 @@ export function productNameLocal(
14
15
  }
15
16
 
16
17
  const replaceProductNameRecursion = (
17
- obj: UI_I_Localization,
18
+ localization: UI_I_Localization,
18
19
  productName: any
19
20
  ): UI_I_Localization => {
20
- for (const key of Object.keys(obj)) {
21
- if (typeof obj[key] === 'string') {
22
- obj[key] = (obj[key] as string).replaceAll('{productName}', productName)
23
- } else if (typeof obj[key] === 'object' && obj[key] !== null) {
24
- obj[key] = replaceProductNameRecursion(
25
- obj[key] as UI_I_Localization,
26
- productName
27
- )
21
+ for (const key of Object.keys(localization)) {
22
+ const item = localization[key as UI_T_LanguageKey]
23
+ for (const key2 of Object.keys(item)) {
24
+ item[key2] = item[key2].replaceAll('{productName}', productName)
28
25
  }
29
26
  }
30
27
 
31
- return obj
28
+ return localization
32
29
  }
@@ -11,3 +11,5 @@ export type UI_T_LangValue =
11
11
  | 'kk_KZ'
12
12
  | 'be_BY'
13
13
  | 'BROWSER'
14
+
15
+ export type UI_T_LanguageKey = 'auth'
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bfg-common",
3
3
  "private": false,
4
- "version": "1.3.583",
4
+ "version": "1.3.584",
5
5
  "scripts": {
6
6
  "build": "nuxt build",
7
7
  "dev": "nuxt dev --port=3002",