@@ -25,7 +25,6 @@ import type {
2525 AnyFunctionMiddleware ,
2626 AnyRequestMiddleware ,
2727 AssignAllServerFnContext ,
28- FunctionMiddlewareClientFnResult ,
2928 FunctionMiddlewareServerFnResult ,
3029 IntersectAllValidatorInputs ,
3130 IntersectAllValidatorOutputs ,
@@ -65,7 +64,7 @@ export const createServerFn: CreateServerFn<Register> = (options, __opts) => {
6564 }
6665
6766 const res : ServerFnBuilder < Register , Method > = {
68- options : resolvedOptions as any ,
67+ options : resolvedOptions ,
6968 middleware : ( middleware ) => {
7069 // multiple calls to `middleware()` merge the middlewares with the previously supplied ones
7170 // this is primarily useful for letting users create their own abstractions on top of `createServerFn`
@@ -280,8 +279,8 @@ export async function executeMiddleware(
280279 // Execute the middleware
281280 const result = await middlewareFn ( {
282281 ...ctx ,
283- next : userNext as any ,
284- } as any )
282+ next : userNext ,
283+ } )
285284
286285 // If result is NOT a ctx object, we need to return it as
287286 // the { result }
@@ -782,11 +781,7 @@ function serverFnBaseToMiddleware(
782781 // but not before serializing the context
783782 const res = await options . extractedFn ?.( payload )
784783
785- return next ( res ) as unknown as FunctionMiddlewareClientFnResult <
786- any ,
787- any ,
788- any
789- >
784+ return next ( res )
790785 } ,
791786 server : async ( { next, ...ctx } ) => {
792787 // Execute the server function
0 commit comments