diff --git a/src/types/functions.ts b/src/types/functions.ts index b08820c..168493a 100644 --- a/src/types/functions.ts +++ b/src/types/functions.ts @@ -22,7 +22,7 @@ export type AnyFunc = (...args: any[]) => R; * @returns the function `F` with new return value `R` */ export type OverwriteReturn = - F extends ((...x: infer T) => unknown) ? ((...x: T) => R) : AnyFunc; + F extends ((...x: infer T) => unknown) ? ((...x: T) => R) : never; /** * Returns a tuple type of a functions arguments up to 7. @@ -30,4 +30,4 @@ export type OverwriteReturn = * @returns a tuple containing `F`'s argument types */ export type ArgsAsTuple = - F extends ((...x: infer T) => unknown) ? T : any[]; + F extends ((...x: infer T) => unknown) ? T : never;