Skip to content

Commit 6141e5b

Browse files
committed
prevent unkown to end up in SpiceflowRequest
1 parent 1602afe commit 6141e5b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

spiceflow/src/spiceflow.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1453,10 +1453,12 @@ function bfsFind<T>(
14531453
}
14541454
return
14551455
}
1456+
1457+
14561458
export class SpiceflowRequest<T = any> extends Request {
14571459
validateBody?: ValidationFunction
14581460

1459-
async json(): Promise<T> {
1461+
async json(): Promise<T extends unknown ? any : T> {
14601462
const body = (await super.json()) as Promise<T>
14611463
return runValidation(body, this.validateBody)
14621464
}

0 commit comments

Comments
 (0)