Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Ansonhkg committed Jul 12, 2024
1 parent 4373739 commit 07b2b66
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion local-tests/setup/tinny-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,10 @@ export function randomSolanaPrivateKey() {
* @param ms - The timeout duration in milliseconds.
* @returns A new promise that resolves or rejects based on the original promise or the timeout.
*/
export function withTimeout<T>(promise: Promise<T>, ms: number): Promise<T> {
export function withTimeout<T>(
promise: Promise<T>,
ms: number
): Promise<T | void> {
const timeout = new Promise<T>((_, reject) =>
setTimeout(() => reject(new Error('Timed out')), ms)
);
Expand Down

0 comments on commit 07b2b66

Please sign in to comment.