koatty_router 2.1.5 → 2.1.6
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/.turbo/turbo-build.log +12 -12
- package/CHANGELOG.md +10 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +25 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +25 -1
- package/dist/index.mjs.map +1 -1
- package/dist/package.json +5 -5
- package/package.json +1 -1
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
|
-
> koatty_router@2.1.
|
|
3
|
+
> koatty_router@2.1.6 build /Users/richen/Workspace/nodejs/koatty-monorepo/packages/koatty-router
|
|
4
4
|
> pnpm run build:js && pnpm run build:dts && pnpm run build:doc && pnpm run build:cp
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
> koatty_router@2.1.
|
|
7
|
+
> koatty_router@2.1.6 build:js /Users/richen/Workspace/nodejs/koatty-monorepo/packages/koatty-router
|
|
8
8
|
> tsup
|
|
9
9
|
|
|
10
10
|
[34mCLI[39m Building entry: src/index.ts
|
|
@@ -15,14 +15,14 @@
|
|
|
15
15
|
[34mCLI[39m Cleaning output folder
|
|
16
16
|
[34mCJS[39m Build start
|
|
17
17
|
[34mESM[39m Build start
|
|
18
|
-
[32mCJS[39m [1mdist/index.js [22m[
|
|
19
|
-
[32mCJS[39m [1mdist/index.js.map [22m[
|
|
20
|
-
[32mCJS[39m ⚡️ Build success in
|
|
21
|
-
[32mESM[39m [1mdist/index.mjs [22m[
|
|
22
|
-
[32mESM[39m [1mdist/index.mjs.map [22m[
|
|
23
|
-
[32mESM[39m ⚡️ Build success in
|
|
24
|
-
|
|
25
|
-
> koatty_router@2.1.
|
|
18
|
+
[32mCJS[39m [1mdist/index.js [22m[32m148.11 KB[39m
|
|
19
|
+
[32mCJS[39m [1mdist/index.js.map [22m[32m376.39 KB[39m
|
|
20
|
+
[32mCJS[39m ⚡️ Build success in 978ms
|
|
21
|
+
[32mESM[39m [1mdist/index.mjs [22m[32m142.07 KB[39m
|
|
22
|
+
[32mESM[39m [1mdist/index.mjs.map [22m[32m376.08 KB[39m
|
|
23
|
+
[32mESM[39m ⚡️ Build success in 993ms
|
|
24
|
+
|
|
25
|
+
> koatty_router@2.1.6 build:dts /Users/richen/Workspace/nodejs/koatty-monorepo/packages/koatty-router
|
|
26
26
|
> bash ../../scripts/build-dts.sh
|
|
27
27
|
|
|
28
28
|
🔨 Building type declarations for koatty-router...
|
|
@@ -172,7 +172,7 @@ Analysis will use the bundled TypeScript version 5.8.2
|
|
|
172
172
|
API Extractor completed successfully
|
|
173
173
|
[1G[0K⠙[1G[0K✅ Type declarations built successfully
|
|
174
174
|
|
|
175
|
-
> koatty_router@2.1.
|
|
175
|
+
> koatty_router@2.1.6 build:doc /Users/richen/Workspace/nodejs/koatty-monorepo/packages/koatty-router
|
|
176
176
|
> api-documenter markdown --input temp --output docs/api
|
|
177
177
|
|
|
178
178
|
|
|
@@ -215,7 +215,7 @@ Unsupported block tag: @interface
|
|
|
215
215
|
Unsupported block tag: @RequestBody
|
|
216
216
|
Unsupported block tag: @RequestParam
|
|
217
217
|
|
|
218
|
-
> koatty_router@2.1.
|
|
218
|
+
> koatty_router@2.1.6 build:cp /Users/richen/Workspace/nodejs/koatty-monorepo/packages/koatty-router
|
|
219
219
|
> node ../../scripts/postBuild.js
|
|
220
220
|
|
|
221
221
|
📦 postBuild: koatty-router
|
package/CHANGELOG.md
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -54,7 +54,7 @@ var onFinished__default = /*#__PURE__*/_interopDefault(onFinished);
|
|
|
54
54
|
|
|
55
55
|
/*!
|
|
56
56
|
* @Author: richen
|
|
57
|
-
* @Date: 2026-02-
|
|
57
|
+
* @Date: 2026-02-11 03:41:57
|
|
58
58
|
* @License: BSD (3-Clause)
|
|
59
59
|
* @Copyright (c) - <richenlin(at)gmail.com>
|
|
60
60
|
* @HomePage: https://koatty.org/
|
|
@@ -1224,12 +1224,36 @@ __name(getContentLength, "getContentLength");
|
|
|
1224
1224
|
function payload(options) {
|
|
1225
1225
|
const opts = cacheManager.getMergedOptions(options);
|
|
1226
1226
|
return (ctx, next) => {
|
|
1227
|
+
if (!Object.prototype.hasOwnProperty.call(ctx, "requestHeader")) {
|
|
1228
|
+
Helper5.Helper.define(ctx, "requestHeader", (name) => {
|
|
1229
|
+
return name ? ctx.get(name) : ctx.headers;
|
|
1230
|
+
});
|
|
1231
|
+
}
|
|
1232
|
+
if (!Object.prototype.hasOwnProperty.call(ctx, "requestQuery")) {
|
|
1233
|
+
Helper5.Helper.define(ctx, "requestQuery", (name) => {
|
|
1234
|
+
const queryParams = ctx.query ?? {};
|
|
1235
|
+
return name ? queryParams[name] : queryParams;
|
|
1236
|
+
});
|
|
1237
|
+
}
|
|
1238
|
+
if (!Object.prototype.hasOwnProperty.call(ctx, "requestPathVariable")) {
|
|
1239
|
+
Helper5.Helper.define(ctx, "requestPathVariable", (name) => {
|
|
1240
|
+
const pathParams = ctx.params ?? {};
|
|
1241
|
+
return name ? pathParams[name] : pathParams;
|
|
1242
|
+
});
|
|
1243
|
+
}
|
|
1227
1244
|
if (!Object.prototype.hasOwnProperty.call(ctx, "requestParam")) {
|
|
1228
1245
|
Helper5.Helper.define(ctx, "requestParam", () => queryParser(ctx));
|
|
1229
1246
|
}
|
|
1230
1247
|
if (!Object.prototype.hasOwnProperty.call(ctx, "requestBody")) {
|
|
1231
1248
|
Helper5.Helper.define(ctx, "requestBody", () => bodyParser(ctx, opts));
|
|
1232
1249
|
}
|
|
1250
|
+
if (!Object.prototype.hasOwnProperty.call(ctx, "requestFile")) {
|
|
1251
|
+
Helper5.Helper.define(ctx, "requestFile", async (name) => {
|
|
1252
|
+
const body = await bodyParser(ctx, opts);
|
|
1253
|
+
const files = body.file ?? {};
|
|
1254
|
+
return name ? files[name] : files;
|
|
1255
|
+
});
|
|
1256
|
+
}
|
|
1233
1257
|
return next();
|
|
1234
1258
|
};
|
|
1235
1259
|
}
|