We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ecd0ae9 commit b9bdbf2Copy full SHA for b9bdbf2
src/util/index.ts
@@ -20,6 +20,8 @@ export function isPlainObj(value: unknown): value is JSONObject {
20
* @param abortSignal An abort signal that can cancel the sleep if the signal is aborted.
21
*/
22
export function sleep(ms: number, abortSignal?: AbortSignal) {
23
+ if (ms === 0) return;
24
+
25
return new Promise<void>((resolve) => {
26
// Resolve early if the abort signal has been aborted already
27
if (abortSignal?.aborted) {
0 commit comments