Skip to content

Commit 4d63855

Browse files
committed
Merge branch 'ch-compat-test' of https://github.com/firebase/firebase-js-sdk into ch-compat-test
2 parents 6ae52ac + d9604af commit 4d63855

File tree

3 files changed

+7
-17
lines changed

3 files changed

+7
-17
lines changed

common/api-review/functions-compat.api.md

Lines changed: 0 additions & 10 deletions
This file was deleted.

packages-exp/functions-exp/src/api.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ import {
2626
useFunctionsEmulator as _useFunctionsEmulator,
2727
httpsCallable as _httpsCallable
2828
} from './service';
29-
import { getExpInstance } from '@firebase/util';
29+
import { getModularInstance } from '@firebase/util';
3030

3131
export * from './public-types';
3232

@@ -44,7 +44,7 @@ export function getFunctions(
4444
): Functions {
4545
// Dependencies
4646
const functionsProvider: Provider<'functions-exp'> = _getProvider(
47-
getExpInstance(app),
47+
getModularInstance(app),
4848
FUNCTIONS_TYPE
4949
);
5050
const functionsInstance = functionsProvider.getImmediate({
@@ -68,7 +68,7 @@ export function useFunctionsEmulator(
6868
port: number
6969
): void {
7070
_useFunctionsEmulator(
71-
getExpInstance<FunctionsService>(functionsInstance as FunctionsService),
71+
getModularInstance<FunctionsService>(functionsInstance as FunctionsService),
7272
host,
7373
port
7474
);
@@ -85,7 +85,7 @@ export function httpsCallable<RequestData = unknown, ResponseData = unknown>(
8585
options?: HttpsCallableOptions
8686
): HttpsCallable<RequestData, ResponseData> {
8787
return _httpsCallable<RequestData, ResponseData>(
88-
getExpInstance<FunctionsService>(functionsInstance as FunctionsService),
88+
getModularInstance<FunctionsService>(functionsInstance as FunctionsService),
8989
name,
9090
options
9191
);

packages/util/src/exp.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ interface CompatService<T> {
1919
_delegate?: T;
2020
}
2121

22-
export function getExpInstance<ExpService>(
22+
export function getModularInstance<ExpService>(
2323
service: CompatService<ExpService> | ExpService
2424
): ExpService {
25-
if ((service as { [key: string]: unknown })._delegate) {
26-
return (service as { [key: string]: unknown })._delegate as ExpService;
25+
if ((service as CompatService<ExpService>)._delegate) {
26+
return (service as CompatService<ExpService>)._delegate as ExpService;
2727
} else {
2828
return service as ExpService;
2929
}

0 commit comments

Comments
 (0)