Sha256: 7c2e827cfaa03b7717105b8a9c569109602fdc05a4b24d7a843250d338a40fcc
Contents?: true
Size: 548 Bytes
Versions: 26
Compression:
Stored size: 548 Bytes
Contents
export function baseUrlFromConnectionOptions(options: any): URL { if ('href' in options) { return new URL(options.href) } const protocol = options.port === 443 ? 'https:' : 'http:' const host = options.host const url = new URL(`${protocol}//${host}`) if (options.port) { url.port = options.port.toString() } if (options.path) { url.pathname = options.path } if (options.auth) { const [username, password] = options.auth.split(':') url.username = username url.password = password } return url }
Version data entries
26 entries across 26 versions & 1 rubygems