Skip to content

Commit 3a06919

Browse files
authored
Use built-in delay method (#2373)
1 parent d276dc9 commit 3a06919

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

source/create.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import {setTimeout as delay} from 'node:timers/promises';
12
import is, {assert} from '@sindresorhus/is';
23
import asPromise from './as-promise/index.js';
34
import type {
@@ -17,11 +18,6 @@ import type {Response} from './core/response.js';
1718
import Options, {type OptionsInit} from './core/options.js';
1819
import type {CancelableRequest} from './as-promise/types.js';
1920

20-
// The `delay` package weighs 10KB (!)
21-
const delay = async (ms: number) => new Promise(resolve => {
22-
setTimeout(resolve, ms);
23-
});
24-
2521
const isGotInstance = (value: Got | ExtendOptions): value is Got => is.function(value);
2622

2723
const aliases: readonly HTTPAlias[] = [

0 commit comments

Comments
 (0)