Skip to content

Commit be10adb

Browse files
committed
fix: withAsyncTOTP typings
1 parent d6e736c commit be10adb

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

apps/meteor/client/meteorOverrides/totpOnCall.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ const withSyncTOTP = (call: (name: string, ...args: any[]) => any) => {
4545
};
4646
};
4747

48-
const withAsyncTOTP = <TResult>(callAsync: (name: string, ...args: any[]) => Promise<TResult>) => {
49-
return async function callAsyncWithTOTP(methodName: string, ...args: unknown[]): Promise<TResult> {
48+
const withAsyncTOTP = <T extends (name: string, ...args: any[]) => Promise<any>>(callAsync: T): T => {
49+
return async function callAsyncWithTOTP(methodName: string, ...args: unknown[]): Promise<ReturnType<T>> {
5050
try {
5151
return await callAsync(methodName, ...args);
5252
} catch (error: unknown) {
@@ -56,7 +56,7 @@ const withAsyncTOTP = <TResult>(callAsync: (name: string, ...args: any[]) => Pro
5656
emailOrUsername: undefined,
5757
});
5858
}
59-
};
59+
} as T;
6060
};
6161

6262
Meteor.call = withSyncTOTP(Meteor.call);

apps/meteor/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"scripts": {
1717
"start": "meteor",
1818
"build:ci": "METEOR_DISABLE_OPTIMISTIC_CACHING=1 meteor build --server-only --directory /tmp/dist",
19-
"dev": "NODE_OPTIONS=\"--trace-warnings\" meteor --exclude-archs \"web.browser.legacy, web.cordova\" --no-lint",
19+
"dev": "NODE_OPTIONS=\"--trace-warnings\" meteor --exclude-archs \"web.browser.legacy, web.cordova\"",
2020
"dsv": "meteor npm run dev",
2121
"ha": "meteor npm run ha:start",
2222
"ms": "TRANSPORTER=${TRANSPORTER:-TCP} meteor npm run dev",

0 commit comments

Comments
 (0)