code: function resolveUrl (from, to) {
    if (typeof URL === 'function') {
      // Use the new WHATWG URL API
      return new URL(to, from).href;
    }
    else {
      // Use the legacy url API
      return legacyURL.resolve(from, to);
    }
  }
docs: Resolve the given URL, using either the legacy Node.js url API, or the WHATWG URL API.
  
  @param {string} from
  @param {string} to
  @returns {string}