{"version":3,"file":"logger-Ckep4QXn.mjs","names":[],"sources":["../src/logger.ts"],"sourcesContent":["import colors from 'colors';\nimport { bootstrap } from 'global-agent';\nimport { ProxyAgent, setGlobalDispatcher } from 'undici';\nimport yargs from 'yargs-parser';\n\nexport const logger = console;\n\n// When the proxy env var of flag is specified, initiate the proxy\nconst { httpProxy = process.env.http_proxy } = yargs(process.argv.slice(2));\nif (httpProxy) {\n  logger.info(colors.green(`Initializing proxy: ${httpProxy}`));\n\n  // Use global-agent, which overrides `request` based requests\n  process.env.GLOBAL_AGENT_HTTP_PROXY = httpProxy;\n  bootstrap();\n\n  // Use undici, which overrides `fetch` based requests\n  setGlobalDispatcher(new ProxyAgent(httpProxy));\n}\n"],"mappings":"wJAKA,MAAa,EAAS,QAGhB,CAAE,YAAY,QAAQ,IAAI,YAAe,EAAM,QAAQ,KAAK,MAAM,EAAE,CAAC,CACvE,IACF,EAAO,KAAK,EAAO,MAAM,uBAAuB,IAAY,CAAC,CAG7D,QAAQ,IAAI,wBAA0B,EACtC,GAAW,CAGX,EAAoB,IAAI,EAAW,EAAU,CAAC"}