UNPKG

@temari/digitm

Version:

git commit 规范的 表情emoji 的提交

24 lines (23 loc) 927 B
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.buildFetchOptions = exports.buildAgent = void 0; /* * @Author: saber * @Date: 2021-12-27 18:10:48 * @LastEditTime: 2021-12-27 18:10:48 * @LastEditors: saber * @Description: */ const proxy_agent_1 = __importDefault(require("proxy-agent")); const defaultProxy = process.env.https_proxy || process.env.http_proxy || undefined; const buildAgent = (proxy = defaultProxy) => proxy ? new proxy_agent_1.default(proxy) : undefined; exports.buildAgent = buildAgent; const buildFetchOptions = (options = {}) => { const agent = (0, exports.buildAgent)(options.proxy); return agent ? { agent } : undefined; }; exports.buildFetchOptions = buildFetchOptions; exports.default = exports.buildFetchOptions;