UNPKG

@atlassian/wrm-troubleshooting

Version:

A tool that can help you with troubleshooting the configuration of webpack and Atlassian P2 project.

23 lines 843 B
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.FetchTimeoutError = void 0; exports.fetchWithTimeout = fetchWithTimeout; const abort_controller_1 = require("abort-controller"); const node_fetch_1 = __importDefault(require("node-fetch")); class FetchTimeoutError extends Error { } exports.FetchTimeoutError = FetchTimeoutError; async function fetchWithTimeout(timeout, url, options) { const abortCtrl = new abort_controller_1.AbortController(); setTimeout(() => { abortCtrl.abort(); }, timeout); return (0, node_fetch_1.default)(url, { ...options, signal: abortCtrl.signal, }); } //# sourceMappingURL=fetchWithTimeout.js.map