Skip to content

Commit

Permalink
sleep in utils.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
addievo committed Sep 6, 2023
1 parent dc1da75 commit 137f93f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/utils/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ function promise<T = void>(): PromiseDeconstructed<T> {
};
}

async function sleep(ms: number): Promise<void> {
return await new Promise<void>((r) => setTimeout(r, ms));
}

function parseJSONRPCRequest<T extends JSONValue>(
message: unknown,
): JSONRPCRequest<T> {
Expand Down Expand Up @@ -513,4 +517,5 @@ export {
parseHeadStream,
promise,
isObject,
sleep
};

0 comments on commit 137f93f

Please sign in to comment.