"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const node_fetch_1 = __importDefault(require("node-fetch"));
const proxy_agent_1 = require("proxy-agent");
// The correct proxy `Agent` implementation to use will be determined
// via the `http_proxy` / `https_proxy` / `no_proxy` / etc. env vars
function fetchWithProxy(url, options = {}) {
    const agent = new proxy_agent_1.ProxyAgent();
    return (0, node_fetch_1.default)(url, Object.assign({ agent }, options));
}
exports.default = fetchWithProxy;
