x-error-lib 0.5.3 → 0.5.4

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.
Files changed (2) hide show
  1. package/dist/index.js +19 -26
  2. package/package.json +17 -17
package/dist/index.js CHANGED
@@ -1,37 +1,30 @@
1
- const i = (r, t, e) => {
2
- const n = r[t];
3
- return n ? typeof n == "function" ? n() : Promise.resolve(n) : new Promise((s, o) => {
4
- (typeof queueMicrotask == "function" ? queueMicrotask : setTimeout)(
5
- o.bind(
6
- null,
7
- new Error(
8
- "Unknown variable dynamic import: " + t + (t.split("/").length !== e ? ". Note that variables only represent file names one level deep." : "")
9
- )
10
- )
11
- );
1
+ const i = (r, e, t) => {
2
+ const s = r[e];
3
+ return s ? typeof s == "function" ? s() : Promise.resolve(s) : new Promise((n, o) => {
4
+ (typeof queueMicrotask == "function" ? queueMicrotask : setTimeout)(o.bind(null, /* @__PURE__ */ new Error("Unknown variable dynamic import: " + e + (e.split("/").length !== t ? ". Note that variables only represent file names one level deep." : ""))));
12
5
  });
13
6
  };
14
7
  async function u(r) {
15
8
  return (await i(/* @__PURE__ */ Object.assign({ "./locales/en/index.ts": () => import("./i18n-en.ftlypaed.js"), "./locales/zhHans/index.ts": () => import("./i18n-zhHans.idpuac3m.js") }), `./locales/${r}/index.ts`, 4)).default;
16
9
  }
17
10
  function c(r) {
18
- const t = { main: "", extras: {} };
19
- let e = r.split(";");
20
- return console.assert(e.length > 0), t.main = e[0], e = ((e == null ? void 0 : e[1]) ?? "").split(","), e.forEach((s) => {
21
- const o = s.split("=");
22
- o.length >= 2 && (t.extras[o[0]] = o[1]);
23
- }), t;
11
+ const e = { main: "", extras: {} };
12
+ let t = r.split(";");
13
+ return console.assert(t.length > 0), e.main = t[0], t = (t?.[1] ?? "").split(","), t.forEach((n) => {
14
+ const o = n.split("=");
15
+ o.length >= 2 && (e.extras[o[0]] = o[1]);
16
+ }), e;
24
17
  }
25
- function f(r, t) {
26
- if (typeof t != "string")
27
- return r.global.t("x-error-lib.err.network error", t);
28
- const e = c(t);
29
- let n = r.global.t(`x-error-lib.err.${e.main}`), s = "";
30
- for (const o in e.extras) {
31
- const l = e.extras[o], a = r.global.t(`x-error-lib.obj.${o}=${l}`);
32
- s !== "" && (s += ", "), s += a;
18
+ function f(r, e) {
19
+ if (typeof e != "string")
20
+ return r.global.t("x-error-lib.err.network error", e);
21
+ const t = c(e);
22
+ let s = r.global.t(`x-error-lib.err.${t.main}`), n = "";
23
+ for (const o in t.extras) {
24
+ const a = t.extras[o], l = r.global.t(`x-error-lib.obj.${o}=${a}`);
25
+ n !== "" && (n += ", "), n += l;
33
26
  }
34
- return s !== "" && (n += "; ", n += s), n;
27
+ return n !== "" && (s += "; ", s += n), s;
35
28
  }
36
29
  export {
37
30
  f as getErrorMessage,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "x-error-lib",
3
3
  "private": false,
4
- "version": "0.5.3",
4
+ "version": "0.5.4",
5
5
  "type": "module",
6
6
  "module": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
@@ -22,29 +22,29 @@
22
22
  "*": "prettier --write ."
23
23
  },
24
24
  "dependencies": {
25
- "vue": "^3.5.16",
26
- "vue-i18n": "^11.1.5",
27
- "vuetify": "^3.8.9"
25
+ "vue": "^3.5.17",
26
+ "vue-i18n": "^11.1.9",
27
+ "vuetify": "^3.9.0"
28
28
  },
29
29
  "devDependencies": {
30
- "@eslint/js": "^9.28.0",
31
- "@types/node": "^24.0.1",
32
- "@vitejs/plugin-vue": "^5.2.4",
33
- "eslint": "^9.28.0",
30
+ "@eslint/js": "^9.30.1",
31
+ "@types/node": "^24.0.12",
32
+ "@vitejs/plugin-vue": "^6.0.0",
33
+ "eslint": "^9.30.1",
34
34
  "eslint-config-prettier": "^10.1.5",
35
- "eslint-plugin-prettier": "^5.4.1",
36
- "eslint-plugin-vue": "^10.2.0",
37
- "globals": "^16.2.0",
35
+ "eslint-plugin-prettier": "^5.5.1",
36
+ "eslint-plugin-vue": "^10.3.0",
37
+ "globals": "^16.3.0",
38
38
  "husky": "^9.1.7",
39
- "lint-staged": "^16.1.0",
40
- "prettier": "3.5.3",
39
+ "lint-staged": "^16.1.2",
40
+ "prettier": "3.6.2",
41
41
  "sass": "^1.89.2",
42
42
  "typescript": "^5.8.3",
43
- "typescript-eslint": "^8.34.0",
44
- "vite": "^6.3.5",
43
+ "typescript-eslint": "^8.36.0",
44
+ "vite": "^7.0.3",
45
45
  "vite-plugin-css-injected-by-js": "^3.5.2",
46
46
  "vite-plugin-vuetify": "^2.1.1",
47
- "vue-eslint-parser": "^10.1.3",
48
- "vue-tsc": "^2.2.10"
47
+ "vue-eslint-parser": "^10.2.0",
48
+ "vue-tsc": "^3.0.1"
49
49
  }
50
50
  }