code: function ensureUrl (v) {
    if (typeof v === 'string') {
      return url.parse(v)
    } else if (v instanceof url.Url) {
      return v
    } else if (url.URL && v instanceof url.URL) { // check for url.URL because it wasn't added until Node.js 6.13.0
      return url.parse(v.toString())
    } else {
      return v
    }
  }
docs: NOTE: This will also stringify and parse URL instances to a format which can be mixed into the options object.