@koine/i18n 2.0.0-beta.171 → 2.0.0-beta.172

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.
@@ -49,9 +49,12 @@ export function createT<TDictionary extends I18nUtils.TranslationsDictionaryLoos
49
49
  (typeof value === "object" && !Object.keys(value).length) ||
50
50
  (Array.isArray(value) && !value.length)
51
51
  ) {
52
- return typeof fallback !== "undefined"
53
- ? fallback
54
- : ${"key" === a ? "trace" : '""'} as TReturn;
52
+ return (
53
+ query === ""
54
+ ? value || ""
55
+ : typeof fallback !== "undefined"
56
+ ? fallback
57
+ : ${"key" === a ? "trace" : 'value || ""'}) as TReturn;
55
58
  }
56
59
 
57
60
  return (query ? i18nInterpolateParamsDeep(value, query) : value) as TReturn;
@@ -47,9 +47,12 @@ export function createT<TDictionary extends I18nUtils.TranslationsDictionaryLoos
47
47
  (typeof value === "object" && !Object.keys(value).length) ||
48
48
  (Array.isArray(value) && !value.length)
49
49
  ) {
50
- return typeof fallback !== "undefined"
51
- ? fallback
52
- : ${"key" === a ? "trace" : '""'} as TReturn;
50
+ return (
51
+ query === ""
52
+ ? value || ""
53
+ : typeof fallback !== "undefined"
54
+ ? fallback
55
+ : ${"key" === a ? "trace" : 'value || ""'}) as TReturn;
53
56
  }
54
57
 
55
58
  return (query ? i18nInterpolateParamsDeep(value, query) : value) as TReturn;
package/package.json CHANGED
@@ -5,8 +5,8 @@
5
5
  "node": "^14.18.0 || >=16.0.0"
6
6
  },
7
7
  "dependencies": {
8
- "@koine/node": "2.0.0-beta.171",
9
- "@koine/utils": "2.0.0-beta.171",
8
+ "@koine/node": "2.0.0-beta.172",
9
+ "@koine/utils": "2.0.0-beta.172",
10
10
  "comment-json": "^4.2.4",
11
11
  "consola": "^3.2.3",
12
12
  "glob": "^11.0.0",
@@ -110,5 +110,5 @@
110
110
  "module": "./index.esm.js",
111
111
  "main": "./index.cjs.js",
112
112
  "types": "./index.esm.d.ts",
113
- "version": "2.0.0-beta.171"
113
+ "version": "2.0.0-beta.172"
114
114
  }