@@ -36,22 +36,28 @@ export type GetRpcFunctionFilterBuilderByArgs<
36
36
1 : IsAny < Schema > extends true
37
37
? any
38
38
: IsNever < Args > extends true
39
- ? ExtractExactFunction < Schema [ 'Functions' ] [ FnName ] , Args >
40
- : // Otherwise, we attempt to match with one of the function definition in the union based
41
- // on the function arguments provided
42
- Args extends GenericFunction [ 'Args' ]
43
- ? // This is for retro compatibility, if the funcition is defined with an single return and an union of Args
44
- // we fallback to the last function definition matched by name
45
- IsNever <
46
- LastOf < FindMatchingFunctionByArgs < Schema [ 'Functions' ] [ FnName ] , Args > >
47
- > extends true
48
- ? LastOf < Schema [ 'Functions' ] [ FnName ] >
49
- : // Otherwise, we use the arguments based function definition narrowing to get the right value
50
- LastOf < FindMatchingFunctionByArgs < Schema [ 'Functions' ] [ FnName ] , Args > >
51
- : // If we can't find a matching function by args, we try to find one by function name
52
- ExtractExactFunction < Schema [ 'Functions' ] [ FnName ] , Args > extends GenericFunction
53
- ? ExtractExactFunction < Schema [ 'Functions' ] [ FnName ] , Args >
54
- : any
39
+ ? // This is for retro compatibility, if the funcition is defined with an single return and an union of Args
40
+ // we fallback to the last function definition matched by name
41
+ IsNever < ExtractExactFunction < Schema [ 'Functions' ] [ FnName ] , Args > > extends true
42
+ ? LastOf < Schema [ 'Functions' ] [ FnName ] >
43
+ : ExtractExactFunction < Schema [ 'Functions' ] [ FnName ] , Args >
44
+ : Args extends Record < PropertyKey , never >
45
+ ? LastOf < Schema [ 'Functions' ] [ FnName ] >
46
+ : // Otherwise, we attempt to match with one of the function definition in the union based
47
+ // on the function arguments provided
48
+ Args extends GenericFunction [ 'Args' ]
49
+ ? // This is for retro compatibility, if the funcition is defined with an single return and an union of Args
50
+ // we fallback to the last function definition matched by name
51
+ IsNever <
52
+ LastOf < FindMatchingFunctionByArgs < Schema [ 'Functions' ] [ FnName ] , Args > >
53
+ > extends true
54
+ ? LastOf < Schema [ 'Functions' ] [ FnName ] >
55
+ : // Otherwise, we use the arguments based function definition narrowing to get the right value
56
+ LastOf < FindMatchingFunctionByArgs < Schema [ 'Functions' ] [ FnName ] , Args > >
57
+ : // If we can't find a matching function by args, we try to find one by function name
58
+ ExtractExactFunction < Schema [ 'Functions' ] [ FnName ] , Args > extends GenericFunction
59
+ ? ExtractExactFunction < Schema [ 'Functions' ] [ FnName ] , Args >
60
+ : any
55
61
} [ 1 ] extends infer Fn
56
62
? // If we are dealing with an non-typed client everything is any
57
63
IsAny < Fn > extends true
0 commit comments