Skip to content

Commit

Permalink
fix: format
Browse files Browse the repository at this point in the history
  • Loading branch information
exaby73 committed May 21, 2024
1 parent 00f4531 commit 96d64bf
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 12 deletions.
14 changes: 10 additions & 4 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
// SOFTWARE.

import {
CloudFunction as CloudFunctionV1, HttpsFunction,
CloudFunction as CloudFunctionV1,
HttpsFunction,
Runnable,
} from 'firebase-functions';

Expand All @@ -30,11 +31,14 @@ import {
CloudEvent,
} from 'firebase-functions/v2';

import {CallableFunction, HttpsFunction as HttpsFunctionV2} from 'firebase-functions/v2/https';
import {
CallableFunction,
HttpsFunction as HttpsFunctionV2,
} from 'firebase-functions/v2/https';

import { wrapV1, WrappedFunction, WrappedScheduledFunction } from './v1';

import {wrapV2, WrappedV2Function, WrappedV2CallableFunction} from './v2';
import { wrapV2, WrappedV2Function, WrappedV2CallableFunction } from './v2';

type HttpsFunctionOrCloudFunctionV1<T, U> = U extends HttpsFunction &
Runnable<T>
Expand All @@ -58,7 +62,9 @@ export { WrappedV2Function } from './v2';
export function wrap<T>(
cloudFunction: HttpsFunction & Runnable<T>
): WrappedFunction<T, HttpsFunction & Runnable<T>>;
export function wrap<T>(cloudFunction: CallableFunction<any, T>): WrappedV2CallableFunction<T>;
export function wrap<T>(
cloudFunction: CallableFunction<any, T>
): WrappedV2CallableFunction<T>;
export function wrap<T>(
cloudFunction: CloudFunctionV1<T>
): WrappedScheduledFunction | WrappedFunction<T>;
Expand Down
13 changes: 5 additions & 8 deletions src/v2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,11 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.

import {CloudFunction, CloudEvent} from 'firebase-functions/v2';
import {
CallableFunction,
CallableRequest
} from 'firebase-functions/v2/https';
import { CloudFunction, CloudEvent } from 'firebase-functions/v2';
import { CallableFunction, CallableRequest } from 'firebase-functions/v2/https';

import {generateCombinedCloudEvent} from './cloudevent/generate';
import {DeepPartial} from './cloudevent/types';
import { generateCombinedCloudEvent } from './cloudevent/generate';
import { DeepPartial } from './cloudevent/types';
import * as express from 'express';

/** A function that can be called with test data and optional override values for {@link CloudEvent}
Expand All @@ -38,7 +35,7 @@ export type WrappedV2Function<T extends CloudEvent<unknown>> = (
) => any | Promise<any>;

export type WrappedV2CallableFunction<T> = (
data: CallableRequest,
data: CallableRequest
) => T | Promise<T>;

function isCallableV2Function<T extends CloudEvent<unknown>>(
Expand Down

0 comments on commit 96d64bf

Please sign in to comment.