import { parse } from 'url' ; /**
 * Converts a valid deployment lookup parameter to a hostname.
 * `http://google.com` => google.com
 * google.com => google.com
 */ function toHost ( url ) { if ( /^https?:\/\// . test ( url ) ) { return parse ( url ) . host ! ; } return url . replace ( /(\/\/)?([^/]+)(.*)/ , '$2' ) ; } export default toHost ;