function urlIsSameOriginAsBaseUrl(requestUrl) {
  return urlsAreSameOrigin(requestUrl, getBaseUrl());
}
Parse a request URL and determine whether it is same-origin as the current document base URL.

Note: The base URL is usually the same as the document location (`location.href`) but can
be overriden by using the `<base>` tag.

@param {string|object} requestUrl The url of the request as a string that will be resolved
or a parsed URL object.
@returns {boolean} Whether the URL is same-origin as the document base URL.