Skip to content

Commit 1ff8ff2

Browse files
author
Marcus Olsson
committed
Ensures options object is initialized
Guarantees that the options object is initialized to prevent potential errors when calling cloud functions. This ensures smooth execution even when no options are explicitly provided.
1 parent 7cc7a16 commit 1ff8ff2

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/Cloud.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ export function run<
4646
T extends (param: { [P in keyof Parameters<T>[0]]: Parameters<T>[0][P] }) => any,
4747
>(name: string, data: Parameters<T>[0], options?: RequestOptions): Promise<ReturnType<T>>;
4848
export function run(name: string, data?: any, options?: RequestOptions): Promise<any> {
49+
options = options || {};
4950
if (typeof name !== 'string' || name.length === 0) {
5051
throw new TypeError('Cloud function name must be a string.');
5152
}

0 commit comments

Comments
 (0)