Skip to content

Commit b759670

Browse files
committed
types(defineValidatedHandler): return value should be fetchable
1 parent e43571e commit b759670

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

src/handler.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ export function defineValidatedHandler<
7070
},
7171
Res
7272
>;
73-
}): EventHandler<
73+
}): EventHandlerWithFetch<
7474
TypedRequest<InferOutput<RequestBody>, InferOutput<RequestHeaders>>,
7575
Res
7676
> {

test/handler.test.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import {
88

99
import type { H3Event } from "../src/event.ts";
1010
import { z } from "zod";
11-
import type { EventHandlerWithFetch } from "../src/types/handler.ts";
1211

1312
describe("handler.ts", () => {
1413
describe("defineHandler", () => {
@@ -99,7 +98,7 @@ describe("handler.ts", () => {
9998
headers: event.req.headers,
10099
};
101100
},
102-
}) as unknown as EventHandlerWithFetch; // TODO: fix type incompatibility
101+
});
103102

104103
it("valid request", async () => {
105104
const res = await handler.fetch("/?id=123", {

0 commit comments

Comments
 (0)