+ const isURLOptions = {
+ require_host: true,
+ require_tld: true
+ }
+
+ // We validate 'localhost', so we don't have the top level domain
+ if (isTestInstance()) {
+ isURLOptions.require_tld = false
+ }
+
+ return exists(host) && validator.isURL(host, isURLOptions) && host.split('://').length === 1