@redocly/cli
Version:
[@Redocly](https://redocly.com) CLI is your all-in-one OpenAPI utility. It builds, manages, improves, and quality-checks your OpenAPI descriptions, all of which comes in handy for various phases of the API Lifecycle. Create your own rulesets to make API g
12 lines • 463 B
JavaScript
import { getProxyAgent } from './proxy-agent.js';
import { Agent } from 'undici';
export default async (url, { timeout, ...options } = {}) => {
const dispatcher = getProxyAgent() || (timeout ? new Agent({ connect: { timeout } }) : undefined);
const res = await fetch(url, {
signal: timeout ? AbortSignal.timeout(timeout) : undefined,
...options,
dispatcher,
});
return res;
};
//# sourceMappingURL=fetch-with-timeout.js.map