@lsby/net-core 0.13.8 → 0.13.10

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.
@@ -493,12 +493,9 @@ var Form\u53C2\u6570\u89E3\u6790\u63D2\u4EF6 = class _Form\u53C2\u6570\u89E3\u67
493
493
  let upload = (0, import_multer.default)(opt);
494
494
  let multerMiddleware = upload.any();
495
495
  await new Promise(
496
- (pRes, rej) => multerMiddleware(req, res, (err) => {
497
- if (err === null || typeof err === "undefined") {
498
- pRes(null);
499
- } else {
500
- rej(err);
501
- }
496
+ (pRes, Prej) => multerMiddleware(req, res, (err) => {
497
+ if (err !== null && err !== void 0) Prej(`Form \u89E3\u6790\u5931\u8D25: ${String(err)}`);
498
+ pRes(null);
502
499
  })
503
500
  );
504
501
  await log.debug("\u51C6\u5907\u89E3\u6790 Form \u53C2\u6570\uFF1A%o", JSON.stringify(\u9012\u5F52\u622A\u65AD\u5B57\u7B26\u4E32(req.body)));
@@ -532,7 +529,8 @@ var JSON\u53C2\u6570\u89E3\u6790\u63D2\u4EF6 = class _JSON\u53C2\u6570\u89E3\u67
532
529
  super(\u9519\u8BEF\u7C7B\u578B\u63CF\u8FF03, import_zod3.z.object({ json: t }), async (req, res, \u9644\u52A0\u53C2\u6570) => {
533
530
  let log = \u9644\u52A0\u53C2\u6570.log.extend(_JSON\u53C2\u6570\u89E3\u6790\u63D2\u4EF6.name);
534
531
  await new Promise(
535
- (pRes, _rej) => import_express.default.json(opt)(req, res, () => {
532
+ (pRes, Prej) => import_express.default.json(opt)(req, res, (err) => {
533
+ if (err !== null && err !== void 0) return Prej(`JSON \u89E3\u6790\u5931\u8D25: ${String(err)}`);
536
534
  pRes(null);
537
535
  })
538
536
  );
@@ -619,7 +617,8 @@ var UrlEncoded\u53C2\u6570\u89E3\u6790\u63D2\u4EF6 = class _UrlEncoded\u53C2\u65
619
617
  super(\u9519\u8BEF\u7C7B\u578B\u63CF\u8FF07, import_zod7.z.object({ urlencoded: t }), async (req, res, \u9644\u52A0\u53C2\u6570) => {
620
618
  let log = \u9644\u52A0\u53C2\u6570.log.extend(_UrlEncoded\u53C2\u6570\u89E3\u6790\u63D2\u4EF6.name);
621
619
  await new Promise(
622
- (pRes, _rej) => import_express2.default.urlencoded({ extended: true, ...opt })(req, res, () => {
620
+ (pRes, Prej) => import_express2.default.urlencoded({ extended: true, ...opt })(req, res, (err) => {
621
+ if (err !== null && err !== void 0) return Prej(`UrlEncoded \u89E3\u6790\u5931\u8D25: ${String(err)}`);
623
622
  pRes(null);
624
623
  })
625
624
  );
@@ -95,12 +95,9 @@ var Form\u53C2\u6570\u89E3\u6790\u63D2\u4EF6 = class _Form\u53C2\u6570\u89E3\u67
95
95
  let upload = (0, import_multer.default)(opt);
96
96
  let multerMiddleware = upload.any();
97
97
  await new Promise(
98
- (pRes, rej) => multerMiddleware(req, res, (err) => {
99
- if (err === null || typeof err === "undefined") {
100
- pRes(null);
101
- } else {
102
- rej(err);
103
- }
98
+ (pRes, Prej) => multerMiddleware(req, res, (err) => {
99
+ if (err !== null && err !== void 0) Prej(`Form \u89E3\u6790\u5931\u8D25: ${String(err)}`);
100
+ pRes(null);
104
101
  })
105
102
  );
106
103
  await log.debug("\u51C6\u5907\u89E3\u6790 Form \u53C2\u6570\uFF1A%o", JSON.stringify(\u9012\u5F52\u622A\u65AD\u5B57\u7B26\u4E32(req.body)));
@@ -82,7 +82,8 @@ var JSON\u53C2\u6570\u89E3\u6790\u63D2\u4EF6 = class _JSON\u53C2\u6570\u89E3\u67
82
82
  super(\u9519\u8BEF\u7C7B\u578B\u63CF\u8FF0, import_zod.z.object({ json: t }), async (req, res, \u9644\u52A0\u53C2\u6570) => {
83
83
  let log = \u9644\u52A0\u53C2\u6570.log.extend(_JSON\u53C2\u6570\u89E3\u6790\u63D2\u4EF6.name);
84
84
  await new Promise(
85
- (pRes, _rej) => import_express.default.json(opt)(req, res, () => {
85
+ (pRes, Prej) => import_express.default.json(opt)(req, res, (err) => {
86
+ if (err !== null && err !== void 0) return Prej(`JSON \u89E3\u6790\u5931\u8D25: ${String(err)}`);
86
87
  pRes(null);
87
88
  })
88
89
  );
@@ -82,7 +82,8 @@ var UrlEncoded\u53C2\u6570\u89E3\u6790\u63D2\u4EF6 = class _UrlEncoded\u53C2\u65
82
82
  super(\u9519\u8BEF\u7C7B\u578B\u63CF\u8FF0, import_zod.z.object({ urlencoded: t }), async (req, res, \u9644\u52A0\u53C2\u6570) => {
83
83
  let log = \u9644\u52A0\u53C2\u6570.log.extend(_UrlEncoded\u53C2\u6570\u89E3\u6790\u63D2\u4EF6.name);
84
84
  await new Promise(
85
- (pRes, _rej) => import_express.default.urlencoded({ extended: true, ...opt })(req, res, () => {
85
+ (pRes, Prej) => import_express.default.urlencoded({ extended: true, ...opt })(req, res, (err) => {
86
+ if (err !== null && err !== void 0) return Prej(`UrlEncoded \u89E3\u6790\u5931\u8D25: ${String(err)}`);
86
87
  pRes(null);
87
88
  })
88
89
  );
@@ -16,7 +16,8 @@ var JSON\u53C2\u6570\u89E3\u6790\u63D2\u4EF6 = class _JSON\u53C2\u6570\u89E3\u67
16
16
  super(\u9519\u8BEF\u7C7B\u578B\u63CF\u8FF0, z.object({ json: t }), async (req, res, \u9644\u52A0\u53C2\u6570) => {
17
17
  let log = \u9644\u52A0\u53C2\u6570.log.extend(_JSON\u53C2\u6570\u89E3\u6790\u63D2\u4EF6.name);
18
18
  await new Promise(
19
- (pRes, _rej) => express.json(opt)(req, res, () => {
19
+ (pRes, Prej) => express.json(opt)(req, res, (err) => {
20
+ if (err !== null && err !== void 0) return Prej(`JSON \u89E3\u6790\u5931\u8D25: ${String(err)}`);
20
21
  pRes(null);
21
22
  })
22
23
  );
@@ -29,12 +29,9 @@ var Form\u53C2\u6570\u89E3\u6790\u63D2\u4EF6 = class _Form\u53C2\u6570\u89E3\u67
29
29
  let upload = multer(opt);
30
30
  let multerMiddleware = upload.any();
31
31
  await new Promise(
32
- (pRes, rej) => multerMiddleware(req, res, (err) => {
33
- if (err === null || typeof err === "undefined") {
34
- pRes(null);
35
- } else {
36
- rej(err);
37
- }
32
+ (pRes, Prej) => multerMiddleware(req, res, (err) => {
33
+ if (err !== null && err !== void 0) Prej(`Form \u89E3\u6790\u5931\u8D25: ${String(err)}`);
34
+ pRes(null);
38
35
  })
39
36
  );
40
37
  await log.debug("\u51C6\u5907\u89E3\u6790 Form \u53C2\u6570\uFF1A%o", JSON.stringify(\u9012\u5F52\u622A\u65AD\u5B57\u7B26\u4E32(req.body)));
@@ -16,7 +16,8 @@ var UrlEncoded\u53C2\u6570\u89E3\u6790\u63D2\u4EF6 = class _UrlEncoded\u53C2\u65
16
16
  super(\u9519\u8BEF\u7C7B\u578B\u63CF\u8FF0, z.object({ urlencoded: t }), async (req, res, \u9644\u52A0\u53C2\u6570) => {
17
17
  let log = \u9644\u52A0\u53C2\u6570.log.extend(_UrlEncoded\u53C2\u6570\u89E3\u6790\u63D2\u4EF6.name);
18
18
  await new Promise(
19
- (pRes, _rej) => express.urlencoded({ extended: true, ...opt })(req, res, () => {
19
+ (pRes, Prej) => express.urlencoded({ extended: true, ...opt })(req, res, (err) => {
20
+ if (err !== null && err !== void 0) return Prej(`UrlEncoded \u89E3\u6790\u5931\u8D25: ${String(err)}`);
20
21
  pRes(null);
21
22
  })
22
23
  );
package/dist/esm/index.js CHANGED
@@ -1,9 +1,9 @@
1
1
  import {
2
- EXPORT_TYPE
3
- } from "./chunk-HT7VG4BT.js";
2
+ 静态文件返回器
3
+ } from "./chunk-RWEYJ3T7.js";
4
4
  import {
5
- 服务器
6
- } from "./chunk-AB35ZHL3.js";
5
+ 虚拟文件返回器
6
+ } from "./chunk-WXTNTK3M.js";
7
7
  import "./chunk-XPFEAXE4.js";
8
8
  import "./chunk-BWFSM5FK.js";
9
9
  import {
@@ -11,10 +11,16 @@ import {
11
11
  } from "./chunk-RVEKW2PT.js";
12
12
  import {
13
13
  UrlEncoded参数解析插件
14
- } from "./chunk-QQFE27NG.js";
14
+ } from "./chunk-UK5TCQXV.js";
15
15
  import {
16
16
  WebSocket插件
17
17
  } from "./chunk-7GT72IUT.js";
18
+ import {
19
+ EXPORT_TYPE
20
+ } from "./chunk-HT7VG4BT.js";
21
+ import {
22
+ 服务器
23
+ } from "./chunk-AB35ZHL3.js";
18
24
  import {
19
25
  常用接口返回器
20
26
  } from "./chunk-AOZ3QFOM.js";
@@ -24,12 +30,6 @@ import {
24
30
  import {
25
31
  文件流式下载返回器
26
32
  } from "./chunk-QRJ6A4DG.js";
27
- import {
28
- 静态文件返回器
29
- } from "./chunk-RWEYJ3T7.js";
30
- import {
31
- 虚拟文件返回器
32
- } from "./chunk-WXTNTK3M.js";
33
33
  import {
34
34
  接口返回器
35
35
  } from "./chunk-FP6Q65NN.js";
@@ -45,10 +45,10 @@ import {
45
45
  } from "./chunk-7OU27OBO.js";
46
46
  import {
47
47
  Form参数解析插件
48
- } from "./chunk-LOZ4IPHR.js";
48
+ } from "./chunk-LSQLFSN3.js";
49
49
  import {
50
50
  JSON参数解析插件
51
- } from "./chunk-PAP3X3RJ.js";
51
+ } from "./chunk-33RHYEJH.js";
52
52
  import {
53
53
  调试请求头插件
54
54
  } from "./chunk-RWSXMQQI.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  Form参数解析插件
3
- } from "../chunk-LOZ4IPHR.js";
3
+ } from "../chunk-LSQLFSN3.js";
4
4
  import "../chunk-2CGBESLT.js";
5
5
  import "../chunk-EGIJQJFI.js";
6
6
  export {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  JSON参数解析插件
3
- } from "../chunk-PAP3X3RJ.js";
3
+ } from "../chunk-33RHYEJH.js";
4
4
  import "../chunk-2CGBESLT.js";
5
5
  import "../chunk-EGIJQJFI.js";
6
6
  export {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  UrlEncoded参数解析插件
3
- } from "../chunk-QQFE27NG.js";
3
+ } from "../chunk-UK5TCQXV.js";
4
4
  import "../chunk-2CGBESLT.js";
5
5
  import "../chunk-EGIJQJFI.js";
6
6
  export {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lsby/net-core",
3
- "version": "0.13.8",
3
+ "version": "0.13.10",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/lsby/net-core.git"