denwa-web-shared 1.0.36 → 1.0.37

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.
@@ -87,6 +87,7 @@ const updateTextByTemplate = ({
87
87
  const key = SUBDOMAIN_NAME[subdomain];
88
88
  if (!subdomain || !key) return text;
89
89
  const subdomainData = getByKey(SUBDOMAIN_NAME, subdomain);
90
+ if (!subdomainData) return text;
90
91
  let result = text;
91
92
  const { name, declination, region, regionDeclination } = subdomainData;
92
93
  const cityReg = new RegExp(SUBDOMAIN_MASK.CITY, "g");
@@ -85,6 +85,7 @@ const updateTextByTemplate = ({
85
85
  const key = SUBDOMAIN_NAME[subdomain];
86
86
  if (!subdomain || !key) return text;
87
87
  const subdomainData = getByKey(SUBDOMAIN_NAME, subdomain);
88
+ if (!subdomainData) return text;
88
89
  let result = text;
89
90
  const { name, declination, region, regionDeclination } = subdomainData;
90
91
  const cityReg = new RegExp(SUBDOMAIN_MASK.CITY, "g");
@@ -9,7 +9,7 @@ export declare const getNumberFormatter: (local: string) => Intl.NumberFormat;
9
9
  * @param obj - Объект
10
10
  * @param key - Ключ
11
11
  */
12
- export declare const getByKey: <T extends object, K extends keyof T>(obj: T, key: K) => T[K];
12
+ export declare const getByKey: <T extends object, K extends keyof T>(obj: T, key: K | string) => T[K] | undefined;
13
13
  /**
14
14
  * @description Преобразует value у инпута в поле маски телефона
15
15
  * @param eventValue - исходное значение инпута
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "denwa-web-shared",
3
3
  "private": false,
4
- "version": "1.0.36",
4
+ "version": "1.0.37",
5
5
  "type": "module",
6
6
  "author": "Denwa",
7
7
  "main": "dist/denwa-web-shared.cjs.js",