Skip to content

Commit ec0762c

Browse files
committed
chore: Function -> Fn, like supabase-js
1 parent 2895b77 commit ec0762c

File tree

1 file changed

+8
-11
lines changed

1 file changed

+8
-11
lines changed

src/PostgrestClient.ts

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -121,12 +121,9 @@ export default class PostgrestClient<
121121
* `"estimated"`: Uses exact count for low numbers and planned count for high
122122
* numbers.
123123
*/
124-
rpc<
125-
FunctionName extends string & keyof Schema['Functions'],
126-
Function_ extends Schema['Functions'][FunctionName]
127-
>(
128-
fn: FunctionName,
129-
args: Function_['Args'] = {},
124+
rpc<FnName extends string & keyof Schema['Functions'], Fn extends Schema['Functions'][FnName]>(
125+
fn: FnName,
126+
args: Fn['Args'] = {},
130127
{
131128
head = false,
132129
get = false,
@@ -138,12 +135,12 @@ export default class PostgrestClient<
138135
} = {}
139136
): PostgrestFilterBuilder<
140137
Schema,
141-
Function_['Returns'] extends any[]
142-
? Function_['Returns'][number] extends Record<string, unknown>
143-
? Function_['Returns'][number]
138+
Fn['Returns'] extends any[]
139+
? Fn['Returns'][number] extends Record<string, unknown>
140+
? Fn['Returns'][number]
144141
: never
145142
: never,
146-
Function_['Returns']
143+
Fn['Returns']
147144
> {
148145
let method: 'HEAD' | 'GET' | 'POST'
149146
const url = new URL(`${this.url}/rpc/${fn}`)
@@ -180,6 +177,6 @@ export default class PostgrestClient<
180177
body,
181178
fetch: this.fetch,
182179
allowEmpty: false,
183-
} as unknown as PostgrestBuilder<Function_['Returns']>)
180+
} as unknown as PostgrestBuilder<Fn['Returns']>)
184181
}
185182
}

0 commit comments

Comments
 (0)