@hot-updater/console 0.20.11 → 0.20.13

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/dist/index.cjs CHANGED
@@ -24,12 +24,12 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
24
24
  }) : target, mod));
25
25
 
26
26
  //#endregion
27
+ let fs = require("fs");
28
+ fs = __toESM(fs);
27
29
  let path = require("path");
28
30
  path = __toESM(path);
29
31
  let url = require("url");
30
32
  url = __toESM(url);
31
- let fs = require("fs");
32
- fs = __toESM(fs);
33
33
  let __hot_updater_plugin_core = require("@hot-updater/plugin-core");
34
34
  __hot_updater_plugin_core = __toESM(__hot_updater_plugin_core);
35
35
 
@@ -39,11 +39,10 @@ var getFilePath = (options) => {
39
39
  const defaultDocument = options.defaultDocument || "index.html";
40
40
  if (filename.endsWith("/")) filename = filename.concat(defaultDocument);
41
41
  else if (!filename.match(/\.[a-zA-Z0-9_-]+$/)) filename = filename.concat("/" + defaultDocument);
42
- const path$2 = getFilePathWithoutDefaultDocument({
42
+ return getFilePathWithoutDefaultDocument({
43
43
  root: options.root,
44
44
  filename
45
45
  });
46
- return path$2;
47
46
  };
48
47
  var getFilePathWithoutDefaultDocument = (options) => {
49
48
  let root = options.root || "";
@@ -61,8 +60,7 @@ var getFilePathWithoutDefaultDocument = (options) => {
61
60
  //#endregion
62
61
  //#region ../../node_modules/.pnpm/hono@4.6.3/node_modules/hono/dist/utils/mime.js
63
62
  var getMimeType = (filename, mimes = baseMimes) => {
64
- const regexp = /\.([a-zA-Z0-9]+?)$/;
65
- const match = filename.match(regexp);
63
+ const match = filename.match(/\.([a-zA-Z0-9]+?)$/);
66
64
  if (!match) return;
67
65
  let mimeType = mimes[match[1]];
68
66
  if (mimeType && mimeType.startsWith("text") || mimeType === "application/json") mimeType += "; charset=utf-8";
@@ -136,7 +134,7 @@ var ENCODINGS = {
136
134
  };
137
135
  var ENCODINGS_ORDERED_KEYS = Object.keys(ENCODINGS);
138
136
  var createStreamBody = (stream) => {
139
- const body = new ReadableStream({
137
+ return new ReadableStream({
140
138
  start(controller) {
141
139
  stream.on("data", (chunk) => {
142
140
  controller.enqueue(chunk);
@@ -149,7 +147,6 @@ var createStreamBody = (stream) => {
149
147
  stream.destroy();
150
148
  }
151
149
  });
152
- return body;
153
150
  };
154
151
  var addCurrentDirPrefix = (path$2) => {
155
152
  return `./${path$2}`;
@@ -241,8 +238,7 @@ var serveStatic = (options = { root: "" }) => {
241
238
  //#region ../../node_modules/.pnpm/hono@4.6.3/node_modules/hono/dist/utils/body.js
242
239
  var parseBody = async (request, options = /* @__PURE__ */ Object.create(null)) => {
243
240
  const { all = false, dot = false } = options;
244
- const headers = request instanceof HonoRequest ? request.raw.headers : request.headers;
245
- const contentType = headers.get("Content-Type");
241
+ const contentType = (request instanceof HonoRequest ? request.raw.headers : request.headers).get("Content-Type");
246
242
  if (contentType?.startsWith("multipart/form-data") || contentType?.startsWith("application/x-www-form-urlencoded")) return parseFormData(request, {
247
243
  all,
248
244
  dot
@@ -257,13 +253,11 @@ async function parseFormData(request, options) {
257
253
  function convertFormDataToBodyData(formData, options) {
258
254
  const form = /* @__PURE__ */ Object.create(null);
259
255
  formData.forEach((value, key) => {
260
- const shouldParseAllValues = options.all || key.endsWith("[]");
261
- if (!shouldParseAllValues) form[key] = value;
256
+ if (!(options.all || key.endsWith("[]"))) form[key] = value;
262
257
  else handleParsingAllValues(form, key, value);
263
258
  });
264
259
  if (options.dot) Object.entries(form).forEach(([key, value]) => {
265
- const shouldParseDotValues = key.includes(".");
266
- if (shouldParseDotValues) {
260
+ if (key.includes(".")) {
267
261
  handleParsingNestedValues(form, key, value);
268
262
  delete form[key];
269
263
  }
@@ -296,8 +290,7 @@ var splitPath = (path$2) => {
296
290
  };
297
291
  var splitRoutingPath = (routePath) => {
298
292
  const { groups, path: path$2 } = extractGroupsFromPath(routePath);
299
- const paths = splitPath(path$2);
300
- return replaceGroupMarks(paths, groups);
293
+ return replaceGroupMarks(splitPath(path$2), groups);
301
294
  };
302
295
  var extractGroupsFromPath = (path$2) => {
303
296
  const groups = [];
@@ -423,7 +416,7 @@ var _getQueryParam = (url$1, key, multiple) => {
423
416
  keyIndex2 = url$1.indexOf(`&${key}`, keyIndex2 + 1);
424
417
  }
425
418
  encoded = /[%+]/.test(url$1);
426
- if (!encoded) return void 0;
419
+ if (!encoded) return;
427
420
  }
428
421
  const results = {};
429
422
  encoded ??= /[%+]/.test(url$1);
@@ -853,8 +846,7 @@ var Hono$1 = class {
853
846
  #path = "/";
854
847
  routes = [];
855
848
  constructor(options = {}) {
856
- const allMethods = [...METHODS, METHOD_NAME_ALL_LOWERCASE];
857
- allMethods.forEach((method) => {
849
+ [...METHODS, METHOD_NAME_ALL_LOWERCASE].forEach((method) => {
858
850
  this[method] = (args1, ...args) => {
859
851
  if (typeof args1 === "string") this.#path = args1;
860
852
  else this.addRoute(method, this.#path, args1);
@@ -1099,8 +1091,7 @@ var Node$1 = class {
1099
1091
  node.insert(restTokens, index, paramMap, context, pathErrorCheckOnly);
1100
1092
  }
1101
1093
  buildRegExpStr() {
1102
- const childKeys = Object.keys(this.children).sort(compareKey);
1103
- const strList = childKeys.map((k) => {
1094
+ const strList = Object.keys(this.children).sort(compareKey).map((k) => {
1104
1095
  const c = this.children[k];
1105
1096
  return (typeof c.varIndex === "number" ? `(${k})@${c.varIndex}` : regExpMetaChars.has(k) ? `\\${k}` : k) + c.buildRegExpStr();
1106
1097
  });
@@ -1228,9 +1219,8 @@ function buildMatcherFromPreprocessedRoutes(routes) {
1228
1219
  ];
1229
1220
  }
1230
1221
  function findMiddleware(middleware, path$2) {
1231
- if (!middleware) return void 0;
1222
+ if (!middleware) return;
1232
1223
  for (const k of Object.keys(middleware).sort((a, b) => b.length - a.length)) if (buildWildcardRegExp(k).test(path$2)) return [...middleware[k]];
1233
- return void 0;
1234
1224
  }
1235
1225
  var RegExpRouter = class {
1236
1226
  name = "RegExpRouter";
@@ -1413,13 +1403,12 @@ var Node = class {
1413
1403
  }
1414
1404
  if (!curNode.methods.length) curNode.methods = [];
1415
1405
  const m = /* @__PURE__ */ Object.create(null);
1416
- const handlerSet = {
1406
+ m[method] = {
1417
1407
  handler,
1418
1408
  possibleKeys: possibleKeys.filter((v, i, a) => a.indexOf(v) === i),
1419
1409
  name: this.name,
1420
1410
  score: this.order
1421
1411
  };
1422
- m[method] = handlerSet;
1423
1412
  curNode.methods.push(m);
1424
1413
  return curNode;
1425
1414
  }
@@ -1444,8 +1433,7 @@ var Node = class {
1444
1433
  search(method, path$2) {
1445
1434
  const handlerSets = [];
1446
1435
  this.params = /* @__PURE__ */ Object.create(null);
1447
- const curNode = this;
1448
- let curNodes = [curNode];
1436
+ let curNodes = [this];
1449
1437
  const parts = splitPath(path$2);
1450
1438
  for (let i = 0, len = parts.length; i < len; i++) {
1451
1439
  const part = parts[i];
@@ -1497,10 +1485,9 @@ var Node = class {
1497
1485
  }
1498
1486
  curNodes = tempNodes;
1499
1487
  }
1500
- const results = handlerSets.sort((a, b) => {
1488
+ return [handlerSets.sort((a, b) => {
1501
1489
  return a.score - b.score;
1502
- });
1503
- return [results.map(({ handler, params }) => [handler, params])];
1490
+ }).map(({ handler, params }) => [handler, params])];
1504
1491
  }
1505
1492
  };
1506
1493
 
@@ -1538,7 +1525,6 @@ var Hono = class extends Hono$1 {
1538
1525
  //#region ../../node_modules/.pnpm/typia@8.0.3_@samchon+openapi@3.1.0_typescript@5.8.3/node_modules/typia/lib/internal/_validateReport.js
1539
1526
  var require__validateReport = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/typia@8.0.3_@samchon+openapi@3.1.0_typescript@5.8.3/node_modules/typia/lib/internal/_validateReport.js": ((exports) => {
1540
1527
  Object.defineProperty(exports, "__esModule", { value: true });
1541
- exports._validateReport = void 0;
1542
1528
  const _validateReport = (array) => {
1543
1529
  const reportable = (path$2) => {
1544
1530
  if (array.length === 0) return true;
@@ -1558,8 +1544,7 @@ var require__validateReport = /* @__PURE__ */ __commonJS({ "../../node_modules/.
1558
1544
  var validCookieNameRegEx = /^[\w!#$%&'*.^`|~+-]+$/;
1559
1545
  var validCookieValueRegEx = /^[ !#-:<-[\]-~]*$/;
1560
1546
  var parse = (cookie, name) => {
1561
- const pairs = cookie.trim().split(";");
1562
- return pairs.reduce((parsedCookie, pairStr) => {
1547
+ return cookie.trim().split(";").reduce((parsedCookie, pairStr) => {
1563
1548
  pairStr = pairStr.trim();
1564
1549
  const valueStartPos = pairStr.indexOf("=");
1565
1550
  if (valueStartPos === -1) return parsedCookie;
@@ -1577,16 +1562,14 @@ var parse = (cookie, name) => {
1577
1562
  var getCookie = (c, key, prefix) => {
1578
1563
  const cookie = c.req.raw.headers.get("Cookie");
1579
1564
  if (typeof key === "string") {
1580
- if (!cookie) return void 0;
1565
+ if (!cookie) return;
1581
1566
  let finalKey = key;
1582
1567
  if (prefix === "secure") finalKey = "__Secure-" + key;
1583
1568
  else if (prefix === "host") finalKey = "__Host-" + key;
1584
- const obj2 = parse(cookie, finalKey);
1585
- return obj2[finalKey];
1569
+ return parse(cookie, finalKey)[finalKey];
1586
1570
  }
1587
1571
  if (!cookie) return {};
1588
- const obj = parse(cookie);
1589
- return obj;
1572
+ return parse(cookie);
1590
1573
  };
1591
1574
 
1592
1575
  //#endregion
@@ -1600,13 +1583,10 @@ var HTTPException = class extends Error {
1600
1583
  this.status = status;
1601
1584
  }
1602
1585
  getResponse() {
1603
- if (this.res) {
1604
- const newResponse = new Response(this.res.body, {
1605
- status: this.status,
1606
- headers: this.res.headers
1607
- });
1608
- return newResponse;
1609
- }
1586
+ if (this.res) return new Response(this.res.body, {
1587
+ status: this.status,
1588
+ headers: this.res.headers
1589
+ });
1610
1590
  return new Response(this.message, { status: this.status });
1611
1591
  }
1612
1592
  };
@@ -1614,8 +1594,7 @@ var HTTPException = class extends Error {
1614
1594
  //#endregion
1615
1595
  //#region ../../node_modules/.pnpm/hono@4.6.3/node_modules/hono/dist/utils/buffer.js
1616
1596
  var bufferToFormData = (arrayBuffer, contentType) => {
1617
- const response = new Response(arrayBuffer, { headers: { "Content-Type": contentType } });
1618
- return response.formData();
1597
+ return new Response(arrayBuffer, { headers: { "Content-Type": contentType } }).formData();
1619
1598
  };
1620
1599
 
1621
1600
  //#endregion
@@ -1633,8 +1612,7 @@ var validator = (target, validationFunc) => {
1633
1612
  try {
1634
1613
  value = await c.req.json();
1635
1614
  } catch {
1636
- const message = "Malformed JSON in request body";
1637
- throw new HTTPException(400, { message });
1615
+ throw new HTTPException(400, { message: "Malformed JSON in request body" });
1638
1616
  }
1639
1617
  break;
1640
1618
  case "form": {
@@ -1642,8 +1620,7 @@ var validator = (target, validationFunc) => {
1642
1620
  let formData;
1643
1621
  if (c.req.bodyCache.formData) formData = await c.req.bodyCache.formData;
1644
1622
  else try {
1645
- const arrayBuffer = await c.req.arrayBuffer();
1646
- formData = await bufferToFormData(arrayBuffer, contentType);
1623
+ formData = await bufferToFormData(await c.req.arrayBuffer(), contentType);
1647
1624
  c.req.bodyCache.formData = formData;
1648
1625
  } catch (e) {
1649
1626
  let message = "Malformed FormData request.";
package/dist/index.html CHANGED
@@ -5,7 +5,7 @@
5
5
  <link rel="icon" type="image/x-icon" href="/assets/favicon-BkwcEHsj.ico" />
6
6
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
7
  <title>Hot Updater Console</title>
8
- <script type="module" crossorigin src="/assets/index-nGJHe5si.js"></script>
8
+ <script type="module" crossorigin src="/assets/index-BTYk3GnI.js"></script>
9
9
  <link rel="stylesheet" crossorigin href="/assets/index-DUlKsori.css">
10
10
  </head>
11
11
  <body>
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
+ import { createReadStream, lstatSync } from "fs";
1
2
  import path from "path";
2
3
  import { fileURLToPath } from "url";
3
- import { createReadStream, lstatSync } from "fs";
4
4
  import { getCwd, loadConfig } from "@hot-updater/plugin-core";
5
5
 
6
6
  //#region rolldown:runtime
@@ -35,11 +35,10 @@ var getFilePath = (options) => {
35
35
  const defaultDocument = options.defaultDocument || "index.html";
36
36
  if (filename.endsWith("/")) filename = filename.concat(defaultDocument);
37
37
  else if (!filename.match(/\.[a-zA-Z0-9_-]+$/)) filename = filename.concat("/" + defaultDocument);
38
- const path$1 = getFilePathWithoutDefaultDocument({
38
+ return getFilePathWithoutDefaultDocument({
39
39
  root: options.root,
40
40
  filename
41
41
  });
42
- return path$1;
43
42
  };
44
43
  var getFilePathWithoutDefaultDocument = (options) => {
45
44
  let root = options.root || "";
@@ -57,8 +56,7 @@ var getFilePathWithoutDefaultDocument = (options) => {
57
56
  //#endregion
58
57
  //#region ../../node_modules/.pnpm/hono@4.6.3/node_modules/hono/dist/utils/mime.js
59
58
  var getMimeType = (filename, mimes = baseMimes) => {
60
- const regexp = /\.([a-zA-Z0-9]+?)$/;
61
- const match = filename.match(regexp);
59
+ const match = filename.match(/\.([a-zA-Z0-9]+?)$/);
62
60
  if (!match) return;
63
61
  let mimeType = mimes[match[1]];
64
62
  if (mimeType && mimeType.startsWith("text") || mimeType === "application/json") mimeType += "; charset=utf-8";
@@ -132,7 +130,7 @@ var ENCODINGS = {
132
130
  };
133
131
  var ENCODINGS_ORDERED_KEYS = Object.keys(ENCODINGS);
134
132
  var createStreamBody = (stream) => {
135
- const body = new ReadableStream({
133
+ return new ReadableStream({
136
134
  start(controller) {
137
135
  stream.on("data", (chunk) => {
138
136
  controller.enqueue(chunk);
@@ -145,7 +143,6 @@ var createStreamBody = (stream) => {
145
143
  stream.destroy();
146
144
  }
147
145
  });
148
- return body;
149
146
  };
150
147
  var addCurrentDirPrefix = (path$1) => {
151
148
  return `./${path$1}`;
@@ -237,8 +234,7 @@ var serveStatic = (options = { root: "" }) => {
237
234
  //#region ../../node_modules/.pnpm/hono@4.6.3/node_modules/hono/dist/utils/body.js
238
235
  var parseBody = async (request, options = /* @__PURE__ */ Object.create(null)) => {
239
236
  const { all = false, dot = false } = options;
240
- const headers = request instanceof HonoRequest ? request.raw.headers : request.headers;
241
- const contentType = headers.get("Content-Type");
237
+ const contentType = (request instanceof HonoRequest ? request.raw.headers : request.headers).get("Content-Type");
242
238
  if (contentType?.startsWith("multipart/form-data") || contentType?.startsWith("application/x-www-form-urlencoded")) return parseFormData(request, {
243
239
  all,
244
240
  dot
@@ -253,13 +249,11 @@ async function parseFormData(request, options) {
253
249
  function convertFormDataToBodyData(formData, options) {
254
250
  const form = /* @__PURE__ */ Object.create(null);
255
251
  formData.forEach((value, key) => {
256
- const shouldParseAllValues = options.all || key.endsWith("[]");
257
- if (!shouldParseAllValues) form[key] = value;
252
+ if (!(options.all || key.endsWith("[]"))) form[key] = value;
258
253
  else handleParsingAllValues(form, key, value);
259
254
  });
260
255
  if (options.dot) Object.entries(form).forEach(([key, value]) => {
261
- const shouldParseDotValues = key.includes(".");
262
- if (shouldParseDotValues) {
256
+ if (key.includes(".")) {
263
257
  handleParsingNestedValues(form, key, value);
264
258
  delete form[key];
265
259
  }
@@ -292,8 +286,7 @@ var splitPath = (path$1) => {
292
286
  };
293
287
  var splitRoutingPath = (routePath) => {
294
288
  const { groups, path: path$1 } = extractGroupsFromPath(routePath);
295
- const paths = splitPath(path$1);
296
- return replaceGroupMarks(paths, groups);
289
+ return replaceGroupMarks(splitPath(path$1), groups);
297
290
  };
298
291
  var extractGroupsFromPath = (path$1) => {
299
292
  const groups = [];
@@ -419,7 +412,7 @@ var _getQueryParam = (url, key, multiple) => {
419
412
  keyIndex2 = url.indexOf(`&${key}`, keyIndex2 + 1);
420
413
  }
421
414
  encoded = /[%+]/.test(url);
422
- if (!encoded) return void 0;
415
+ if (!encoded) return;
423
416
  }
424
417
  const results = {};
425
418
  encoded ??= /[%+]/.test(url);
@@ -849,8 +842,7 @@ var Hono$1 = class {
849
842
  #path = "/";
850
843
  routes = [];
851
844
  constructor(options = {}) {
852
- const allMethods = [...METHODS, METHOD_NAME_ALL_LOWERCASE];
853
- allMethods.forEach((method) => {
845
+ [...METHODS, METHOD_NAME_ALL_LOWERCASE].forEach((method) => {
854
846
  this[method] = (args1, ...args) => {
855
847
  if (typeof args1 === "string") this.#path = args1;
856
848
  else this.addRoute(method, this.#path, args1);
@@ -1095,8 +1087,7 @@ var Node$1 = class {
1095
1087
  node.insert(restTokens, index, paramMap, context, pathErrorCheckOnly);
1096
1088
  }
1097
1089
  buildRegExpStr() {
1098
- const childKeys = Object.keys(this.children).sort(compareKey);
1099
- const strList = childKeys.map((k) => {
1090
+ const strList = Object.keys(this.children).sort(compareKey).map((k) => {
1100
1091
  const c = this.children[k];
1101
1092
  return (typeof c.varIndex === "number" ? `(${k})@${c.varIndex}` : regExpMetaChars.has(k) ? `\\${k}` : k) + c.buildRegExpStr();
1102
1093
  });
@@ -1224,9 +1215,8 @@ function buildMatcherFromPreprocessedRoutes(routes) {
1224
1215
  ];
1225
1216
  }
1226
1217
  function findMiddleware(middleware, path$1) {
1227
- if (!middleware) return void 0;
1218
+ if (!middleware) return;
1228
1219
  for (const k of Object.keys(middleware).sort((a, b) => b.length - a.length)) if (buildWildcardRegExp(k).test(path$1)) return [...middleware[k]];
1229
- return void 0;
1230
1220
  }
1231
1221
  var RegExpRouter = class {
1232
1222
  name = "RegExpRouter";
@@ -1409,13 +1399,12 @@ var Node = class {
1409
1399
  }
1410
1400
  if (!curNode.methods.length) curNode.methods = [];
1411
1401
  const m = /* @__PURE__ */ Object.create(null);
1412
- const handlerSet = {
1402
+ m[method] = {
1413
1403
  handler,
1414
1404
  possibleKeys: possibleKeys.filter((v, i, a) => a.indexOf(v) === i),
1415
1405
  name: this.name,
1416
1406
  score: this.order
1417
1407
  };
1418
- m[method] = handlerSet;
1419
1408
  curNode.methods.push(m);
1420
1409
  return curNode;
1421
1410
  }
@@ -1440,8 +1429,7 @@ var Node = class {
1440
1429
  search(method, path$1) {
1441
1430
  const handlerSets = [];
1442
1431
  this.params = /* @__PURE__ */ Object.create(null);
1443
- const curNode = this;
1444
- let curNodes = [curNode];
1432
+ let curNodes = [this];
1445
1433
  const parts = splitPath(path$1);
1446
1434
  for (let i = 0, len = parts.length; i < len; i++) {
1447
1435
  const part = parts[i];
@@ -1493,10 +1481,9 @@ var Node = class {
1493
1481
  }
1494
1482
  curNodes = tempNodes;
1495
1483
  }
1496
- const results = handlerSets.sort((a, b) => {
1484
+ return [handlerSets.sort((a, b) => {
1497
1485
  return a.score - b.score;
1498
- });
1499
- return [results.map(({ handler, params }) => [handler, params])];
1486
+ }).map(({ handler, params }) => [handler, params])];
1500
1487
  }
1501
1488
  };
1502
1489
 
@@ -1534,7 +1521,6 @@ var Hono = class extends Hono$1 {
1534
1521
  //#region ../../node_modules/.pnpm/typia@8.0.3_@samchon+openapi@3.1.0_typescript@5.8.3/node_modules/typia/lib/internal/_validateReport.js
1535
1522
  var require__validateReport = /* @__PURE__ */ __commonJS({ "../../node_modules/.pnpm/typia@8.0.3_@samchon+openapi@3.1.0_typescript@5.8.3/node_modules/typia/lib/internal/_validateReport.js": ((exports) => {
1536
1523
  Object.defineProperty(exports, "__esModule", { value: true });
1537
- exports._validateReport = void 0;
1538
1524
  const _validateReport = (array) => {
1539
1525
  const reportable = (path$1) => {
1540
1526
  if (array.length === 0) return true;
@@ -1554,8 +1540,7 @@ var require__validateReport = /* @__PURE__ */ __commonJS({ "../../node_modules/.
1554
1540
  var validCookieNameRegEx = /^[\w!#$%&'*.^`|~+-]+$/;
1555
1541
  var validCookieValueRegEx = /^[ !#-:<-[\]-~]*$/;
1556
1542
  var parse = (cookie, name) => {
1557
- const pairs = cookie.trim().split(";");
1558
- return pairs.reduce((parsedCookie, pairStr) => {
1543
+ return cookie.trim().split(";").reduce((parsedCookie, pairStr) => {
1559
1544
  pairStr = pairStr.trim();
1560
1545
  const valueStartPos = pairStr.indexOf("=");
1561
1546
  if (valueStartPos === -1) return parsedCookie;
@@ -1573,16 +1558,14 @@ var parse = (cookie, name) => {
1573
1558
  var getCookie = (c, key, prefix) => {
1574
1559
  const cookie = c.req.raw.headers.get("Cookie");
1575
1560
  if (typeof key === "string") {
1576
- if (!cookie) return void 0;
1561
+ if (!cookie) return;
1577
1562
  let finalKey = key;
1578
1563
  if (prefix === "secure") finalKey = "__Secure-" + key;
1579
1564
  else if (prefix === "host") finalKey = "__Host-" + key;
1580
- const obj2 = parse(cookie, finalKey);
1581
- return obj2[finalKey];
1565
+ return parse(cookie, finalKey)[finalKey];
1582
1566
  }
1583
1567
  if (!cookie) return {};
1584
- const obj = parse(cookie);
1585
- return obj;
1568
+ return parse(cookie);
1586
1569
  };
1587
1570
 
1588
1571
  //#endregion
@@ -1596,13 +1579,10 @@ var HTTPException = class extends Error {
1596
1579
  this.status = status;
1597
1580
  }
1598
1581
  getResponse() {
1599
- if (this.res) {
1600
- const newResponse = new Response(this.res.body, {
1601
- status: this.status,
1602
- headers: this.res.headers
1603
- });
1604
- return newResponse;
1605
- }
1582
+ if (this.res) return new Response(this.res.body, {
1583
+ status: this.status,
1584
+ headers: this.res.headers
1585
+ });
1606
1586
  return new Response(this.message, { status: this.status });
1607
1587
  }
1608
1588
  };
@@ -1610,8 +1590,7 @@ var HTTPException = class extends Error {
1610
1590
  //#endregion
1611
1591
  //#region ../../node_modules/.pnpm/hono@4.6.3/node_modules/hono/dist/utils/buffer.js
1612
1592
  var bufferToFormData = (arrayBuffer, contentType) => {
1613
- const response = new Response(arrayBuffer, { headers: { "Content-Type": contentType } });
1614
- return response.formData();
1593
+ return new Response(arrayBuffer, { headers: { "Content-Type": contentType } }).formData();
1615
1594
  };
1616
1595
 
1617
1596
  //#endregion
@@ -1629,8 +1608,7 @@ var validator = (target, validationFunc) => {
1629
1608
  try {
1630
1609
  value = await c.req.json();
1631
1610
  } catch {
1632
- const message = "Malformed JSON in request body";
1633
- throw new HTTPException(400, { message });
1611
+ throw new HTTPException(400, { message: "Malformed JSON in request body" });
1634
1612
  }
1635
1613
  break;
1636
1614
  case "form": {
@@ -1638,8 +1616,7 @@ var validator = (target, validationFunc) => {
1638
1616
  let formData;
1639
1617
  if (c.req.bodyCache.formData) formData = await c.req.bodyCache.formData;
1640
1618
  else try {
1641
- const arrayBuffer = await c.req.arrayBuffer();
1642
- formData = await bufferToFormData(arrayBuffer, contentType);
1619
+ formData = await bufferToFormData(await c.req.arrayBuffer(), contentType);
1643
1620
  c.req.bodyCache.formData = formData;
1644
1621
  } catch (e) {
1645
1622
  let message = "Malformed FormData request.";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@hot-updater/console",
3
3
  "type": "module",
4
- "version": "0.20.11",
4
+ "version": "0.20.13",
5
5
  "files": [
6
6
  "dist",
7
7
  "package.json"
@@ -48,12 +48,12 @@
48
48
  "vite": "^6.1.0",
49
49
  "vite-plugin-solid": "^2.11.1",
50
50
  "vite-tsconfig-paths": "^5.1.4",
51
- "@hot-updater/mock": "0.20.11"
51
+ "@hot-updater/mock": "0.20.13"
52
52
  },
53
53
  "dependencies": {
54
54
  "solid-icons": "^1.1.0",
55
- "@hot-updater/core": "0.20.11",
56
- "@hot-updater/plugin-core": "0.20.11"
55
+ "@hot-updater/core": "0.20.13",
56
+ "@hot-updater/plugin-core": "0.20.13"
57
57
  },
58
58
  "description": "React Native OTA solution for self-hosted",
59
59
  "license": "MIT",