Skip to content

Commit

Permalink
improved delay function
Browse files Browse the repository at this point in the history
  • Loading branch information
marcellocurto committed Nov 5, 2024
1 parent df782c3 commit 8c2ec92
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@ export function getErrorMessage(error: Error | unknown) {
}

export async function delay(ms = 0) {
if (!ms || typeof ms !== 'number' || ms <= 0) return;
return await new Promise((resolve) => setTimeout(resolve, ms));
}

0 comments on commit 8c2ec92

Please sign in to comment.