File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
packages/core/functions-js/src Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -6,9 +6,9 @@ export class FunctionsClient {
66 protected headers : { [ key : string ] : string }
77 protected fetch : Fetch
88
9- constructor ( url : string , headers : { [ key : string ] : string } , customFetch ?: Fetch ) {
9+ constructor ( url : string , headers ? : { [ key : string ] : string } , customFetch ?: Fetch ) {
1010 this . url = url
11- this . headers = headers
11+ this . headers = headers ?? { }
1212
1313 this . fetch = resolveFetch ( customFetch )
1414 }
@@ -29,10 +29,10 @@ export class FunctionsClient {
2929 * `body`: the body of the request
3030 * `responseType`: how the response should be parsed. The default is `json`
3131 */
32- async invoke (
32+ async invoke < T = string > (
3333 functionName : string ,
3434 invokeOptions ?: FunctionInvokeOptions
35- ) : Promise < { data : string | null ; error : Error | null } > {
35+ ) : Promise < { data : T | null ; error : Error | null } > {
3636 try {
3737 const { headers, body } = invokeOptions ?? { }
3838 const response = await this . fetch ( `${ this . url } /${ functionName } ` , {
You can’t perform that action at this time.
0 commit comments