@kanjijs/platform-hono 0.2.0-beta.10 → 0.2.0-beta.12
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.js +14 -1
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -3332,7 +3332,20 @@ class KanjijsAdapter {
|
|
|
3332
3332
|
handlers.push(createValidationMiddleware(routeMeta.contract, validator));
|
|
3333
3333
|
}
|
|
3334
3334
|
handlers.push(async (c) => {
|
|
3335
|
-
|
|
3335
|
+
const result = await instance[methodName](c);
|
|
3336
|
+
if (result instanceof Response) {
|
|
3337
|
+
return result;
|
|
3338
|
+
}
|
|
3339
|
+
if (typeof result === "string") {
|
|
3340
|
+
return c.text(result);
|
|
3341
|
+
}
|
|
3342
|
+
if (result === null || result === undefined) {
|
|
3343
|
+
return c.body(null, 204);
|
|
3344
|
+
}
|
|
3345
|
+
if (typeof result === "object") {
|
|
3346
|
+
return c.json(result);
|
|
3347
|
+
}
|
|
3348
|
+
return c.text(String(result));
|
|
3336
3349
|
});
|
|
3337
3350
|
app.on([routeMeta.method], [fullPath], ...handlers);
|
|
3338
3351
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kanjijs/platform-hono",
|
|
3
|
-
"version": "0.2.0-beta.
|
|
3
|
+
"version": "0.2.0-beta.12",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -13,12 +13,12 @@
|
|
|
13
13
|
"build": "bun build src/index.ts --outdir dist --target bun"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@kanjijs/common": "^0.2.0-beta.
|
|
17
|
-
"@kanjijs/contracts": "^0.2.0-beta.
|
|
16
|
+
"@kanjijs/common": "^0.2.0-beta.12",
|
|
17
|
+
"@kanjijs/contracts": "^0.2.0-beta.12",
|
|
18
18
|
"hono": "^4.0.0",
|
|
19
19
|
"reflect-metadata": "^0.2.0"
|
|
20
20
|
},
|
|
21
21
|
"peerDependencies": {
|
|
22
|
-
"@kanjijs/core": "^0.2.0-beta.
|
|
22
|
+
"@kanjijs/core": "^0.2.0-beta.12"
|
|
23
23
|
}
|
|
24
24
|
}
|