carloscuesta/gitmoji-cli

View on GitHub
src/utils/buildFetchOptions.js

Summary

Maintainability
A
0 mins
Test Coverage
// @flow
import { ProxyAgent } from 'proxy-agent'

export const buildFetchOptions = (): ?{ agent: Object } => {
  const isProxyConfigured = process.env.https_proxy || process.env.http_proxy
  return isProxyConfigured ? { agent: new ProxyAgent() } : undefined
}

export default buildFetchOptions