@finesoft/front 0.1.47 → 0.1.49

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@finesoft/front",
3
- "version": "0.1.47",
3
+ "version": "0.1.49",
4
4
  "description": "Full-stack framework: router, DI, actions, SSR, and server — all in one package",
5
5
  "license": "MIT",
6
6
  "files": [
@@ -1,38 +0,0 @@
1
- //#region \0rolldown/runtime.js
2
- var __defProp = Object.defineProperty;
3
- var __exportAll = (all, no_symbols) => {
4
- let target = {};
5
- for (var name in all) __defProp(target, name, {
6
- get: all[name],
7
- enumerable: true
8
- });
9
- if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
10
- return target;
11
- };
12
- //#endregion
13
- //#region ../server/src/locale.ts
14
- var locale_exports = /* @__PURE__ */ __exportAll({ parseAcceptLanguage: () => parseAcceptLanguage });
15
- /**
16
- * Accept-Language 解析
17
- */
18
- function parseAcceptLanguage(header, supported, fallback) {
19
- const effectiveSupported = supported ?? ["zh", "en"];
20
- const effectiveFallback = fallback ?? effectiveSupported[0] ?? "en";
21
- if (!header) return effectiveFallback;
22
- const langs = header.split(",").map((part) => {
23
- const [lang, q] = part.trim().split(";q=");
24
- return {
25
- lang: lang.trim().toLowerCase(),
26
- q: q ? parseFloat(q) || 0 : 1
27
- };
28
- }).sort((a, b) => b.q - a.q);
29
- for (const { lang } of langs) {
30
- const prefix = lang.split("-")[0];
31
- if (effectiveSupported.includes(prefix)) return prefix;
32
- }
33
- return effectiveFallback;
34
- }
35
- //#endregion
36
- export { parseAcceptLanguage as n, locale_exports as t };
37
-
38
- //# sourceMappingURL=locale-CvU-U6aP.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"locale-CvU-U6aP.mjs","names":[],"sources":["../../server/src/locale.ts"],"sourcesContent":["/**\n * Accept-Language 解析\n */\n\nexport function parseAcceptLanguage(\n header: string | undefined,\n supported?: string[],\n fallback?: string,\n): string {\n const effectiveSupported = supported ?? [\"zh\", \"en\"];\n const effectiveFallback = fallback ?? effectiveSupported[0] ?? \"en\";\n if (!header) return effectiveFallback;\n const langs = header\n .split(\",\")\n .map((part) => {\n const [lang, q] = part.trim().split(\";q=\");\n return {\n lang: lang.trim().toLowerCase(),\n q: q ? parseFloat(q) || 0 : 1,\n };\n })\n .sort((a, b) => b.q - a.q);\n\n for (const { lang } of langs) {\n const prefix = lang.split(\"-\")[0];\n if (effectiveSupported.includes(prefix)) {\n return prefix;\n }\n }\n return effectiveFallback;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAIA,SAAgB,oBACZ,QACA,WACA,UACM;CACN,MAAM,qBAAqB,aAAa,CAAC,MAAM,KAAK;CACpD,MAAM,oBAAoB,YAAY,mBAAmB,MAAM;AAC/D,KAAI,CAAC,OAAQ,QAAO;CACpB,MAAM,QAAQ,OACT,MAAM,IAAI,CACV,KAAK,SAAS;EACX,MAAM,CAAC,MAAM,KAAK,KAAK,MAAM,CAAC,MAAM,MAAM;AAC1C,SAAO;GACH,MAAM,KAAK,MAAM,CAAC,aAAa;GAC/B,GAAG,IAAI,WAAW,EAAE,IAAI,IAAI;GAC/B;GACH,CACD,MAAM,GAAG,MAAM,EAAE,IAAI,EAAE,EAAE;AAE9B,MAAK,MAAM,EAAE,UAAU,OAAO;EAC1B,MAAM,SAAS,KAAK,MAAM,IAAI,CAAC;AAC/B,MAAI,mBAAmB,SAAS,OAAO,CACnC,QAAO;;AAGf,QAAO"}