Skip to content

Commit 0c05f70

Browse files
committed
Fixed build?
1 parent b16903b commit 0c05f70

File tree

5 files changed

+8
-13
lines changed

5 files changed

+8
-13
lines changed

packages/functions/src/config.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ const MESSAGING_INTERNAL_NAME: MessagingInternalComponentName =
3636
'messaging-internal';
3737

3838
export function registerFunctions(
39-
fetchImpl: typeof fetch,
4039
variant?: string
4140
): void {
4241
const factory: InstanceFactory<'functions'> = (
@@ -55,8 +54,7 @@ export function registerFunctions(
5554
authProvider,
5655
messagingProvider,
5756
appCheckProvider,
58-
regionOrCustomDomain,
59-
fetchImpl
57+
regionOrCustomDomain
6058
);
6159
};
6260

packages/functions/src/index.node.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ import { registerFunctions } from './config';
1919
export * from './api';
2020

2121
// eslint-disable-next-line @typescript-eslint/no-explicit-any
22-
registerFunctions(fetch, 'node');
22+
registerFunctions('node');

packages/functions/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ import { registerFunctions } from './config';
2525
export * from './api';
2626
export * from './public-types';
2727

28-
registerFunctions(fetch.bind(self));
28+
registerFunctions();

packages/functions/src/service.ts

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,7 @@ export class FunctionsService implements _FirebaseService {
104104
authProvider: Provider<FirebaseAuthInternalName>,
105105
messagingProvider: Provider<MessagingInternalComponentName>,
106106
appCheckProvider: Provider<AppCheckInternalComponentName>,
107-
regionOrCustomDomain: string = DEFAULT_REGION,
108-
readonly fetchImpl: typeof fetch
107+
regionOrCustomDomain: string = DEFAULT_REGION
109108
) {
110109
this.contextProvider = new ContextProvider(
111110
authProvider,
@@ -212,14 +211,13 @@ export function httpsCallableFromURL<RequestData, ResponseData>(
212211
async function postJSON(
213212
url: string,
214213
body: unknown,
215-
headers: { [key: string]: string },
216-
fetchImpl: typeof fetch
214+
headers: { [key: string]: string }
217215
): Promise<HttpResponse> {
218216
headers['Content-Type'] = 'application/json';
219217

220218
let response: Response;
221219
try {
222-
response = await fetchImpl(url, {
220+
response = await fetch(url, {
223221
method: 'POST',
224222
body: JSON.stringify(body),
225223
headers
@@ -296,7 +294,7 @@ async function callAtURL(
296294

297295
const failAfterHandle = failAfter(timeout);
298296
const response = await Promise.race([
299-
postJSON(url, body, headers, functionsInstance.fetchImpl),
297+
postJSON(url, body, headers),
300298
failAfterHandle.promise,
301299
functionsInstance.cancelAllRequests
302300
]);

packages/functions/test/utils.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,7 @@ export function createTestService(
6262
authProvider,
6363
messagingProvider,
6464
appCheckProvider,
65-
region,
66-
fetch
65+
region
6766
);
6867
const useEmulator = !!process.env.FIREBASE_FUNCTIONS_EMULATOR_ORIGIN;
6968
if (useEmulator) {

0 commit comments

Comments
 (0)