function shouldProxy(hostname, port, options) {
    const NO_PROXY =
        (getEnv('npm_config_no_proxy', options) || getEnv('no_proxy', options)).toLowerCase()
    if (!NO_PROXY) {
        return true  // Always proxy if NO_PROXY is not set.
    }
    if (NO_PROXY === '*') {
        return false  // Never proxy if wildcard is set.
    }

    return NO_PROXY.split(/[,\s]/).every(function (proxy) {
        if (!proxy) {
            return true  // Skip zero-length hosts.
        }
        const parsedProxy = proxy.match(/^(.+):(\d+)$/)
        let parsedProxyHostname = parsedProxy ? parsedProxy[1] : proxy
        const parsedProxyPort = parsedProxy ? parseInt(parsedProxy[2]) : 0
        if (parsedProxyPort && parsedProxyPort !== port) {
            return true  // Skip if ports don't match.
        }

        if (!/^[.*]/.test(parsedProxyHostname)) {
            // No wildcards, so stop proxying if there is an exact match.
            return hostname !== parsedProxyHostname
        }

        if (parsedProxyHostname.charAt(0) === '*') {
            // Remove leading wildcard.
            parsedProxyHostname = parsedProxyHostname.slice(1)
        }
        // Stop proxying if the hostname ends with the no_proxy host.
        return !hostname.endsWith(parsedProxyHostname)
    })
}
Determines whether a given URL should be proxied.

@param {string} hostname - The host name of the URL.
@param {number} port - The effective port of the URL.
@returns {boolean} Whether the given URL should be proxied.
@private