Skip to content

Commit

Permalink
Use built-in delay method (#2373)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sadzurami authored Aug 17, 2024
1 parent d276dc9 commit 3a06919
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions source/create.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import {setTimeout as delay} from 'node:timers/promises';
import is, {assert} from '@sindresorhus/is';
import asPromise from './as-promise/index.js';
import type {
Expand All @@ -17,11 +18,6 @@ import type {Response} from './core/response.js';
import Options, {type OptionsInit} from './core/options.js';
import type {CancelableRequest} from './as-promise/types.js';

// The `delay` package weighs 10KB (!)
const delay = async (ms: number) => new Promise(resolve => {
setTimeout(resolve, ms);
});

const isGotInstance = (value: Got | ExtendOptions): value is Got => is.function(value);

const aliases: readonly HTTPAlias[] = [
Expand Down

0 comments on commit 3a06919

Please sign in to comment.