@qrvey/utils 1.2.9-20 → 1.2.9-21

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
@@ -1,4 +1,4 @@
1
- # [@qrvey/utils](https://bitbucket.org/qrvey/qrvey_utils/wiki/Home) *1.2.9-20*
1
+ # [@qrvey/utils](https://bitbucket.org/qrvey/qrvey_utils/wiki/Home) *1.2.9-21*
2
2
 
3
3
  > Helper, Utils for all Qrvey Projects
4
4
 
@@ -12,12 +12,10 @@ const getLang = (locale) => {
12
12
  };
13
13
  exports.getLang = getLang;
14
14
  const chooseLang = (config) => {
15
- var _a, _b, _c, _d, _e;
15
+ var _a, _b;
16
16
  const lang = (((_a = config === null || config === void 0 ? void 0 : config.i18n) === null || _a === void 0 ? void 0 : _a.lang) ||
17
- ((_c = (_b = config === null || config === void 0 ? void 0 : config.i18n) === null || _b === void 0 ? void 0 : _b.locale) === null || _c === void 0 ? void 0 : _c.lang) ||
18
- ((_d = config === null || config === void 0 ? void 0 : config.locale) === null || _d === void 0 ? void 0 : _d.lang) ||
19
17
  config.lang);
20
- return ((_e = lang) === null || _e === void 0 ? void 0 : _e.lang) || lang || definition_1.LANG_DEFAULT;
18
+ return ((_b = lang) === null || _b === void 0 ? void 0 : _b.lang) || lang || definition_1.LANG_DEFAULT;
21
19
  };
22
20
  exports.chooseLang = chooseLang;
23
21
  const formatWithLocale = (value, outputFormat, config = {}) => {
@@ -8,12 +8,10 @@ export const getLang = (locale) => {
8
8
  return { lang: locale === "browser" ? window.navigator.language : locale };
9
9
  };
10
10
  export const chooseLang = (config) => {
11
- var _a, _b, _c, _d, _e;
11
+ var _a, _b;
12
12
  const lang = (((_a = config === null || config === void 0 ? void 0 : config.i18n) === null || _a === void 0 ? void 0 : _a.lang) ||
13
- ((_c = (_b = config === null || config === void 0 ? void 0 : config.i18n) === null || _b === void 0 ? void 0 : _b.locale) === null || _c === void 0 ? void 0 : _c.lang) ||
14
- ((_d = config === null || config === void 0 ? void 0 : config.locale) === null || _d === void 0 ? void 0 : _d.lang) ||
15
13
  config.lang);
16
- return ((_e = lang) === null || _e === void 0 ? void 0 : _e.lang) || lang || LANG_DEFAULT;
14
+ return ((_b = lang) === null || _b === void 0 ? void 0 : _b.lang) || lang || LANG_DEFAULT;
17
15
  };
18
16
  export const formatWithLocale = (value, outputFormat, config = {}) => {
19
17
  switch (outputFormat.type) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qrvey/utils",
3
- "version": "1.2.9-20",
3
+ "version": "1.2.9-21",
4
4
  "description": "Helper, Utils for all Qrvey Projects",
5
5
  "homepage": "https://bitbucket.org/qrvey/qrvey_utils/wiki/Home",
6
6
  "main": "dist/index.js",
@@ -10,8 +10,6 @@ export const getLang = (locale: string | Record<string, any>) => {
10
10
  export const chooseLang = (config: Record<string, any>): string => {
11
11
  const lang: string | Record<string, any> = (
12
12
  config?.i18n?.lang ||
13
- config?.i18n?.locale?.lang ||
14
- config?.locale?.lang ||
15
13
  config.lang
16
14
  );
17
15
  return (<any>lang)?.lang || lang || LANG_DEFAULT;