src/lib/history.js
function sameOrigin(url) {
  let origin = `${location.protocol}//${location.hostname}`;

  if (location.port) {
    origin += `:${location.port}`;
  }
  return url && url.indexOf(origin) === 0;
}
function sameOrigin(url) {
  let origin = `${location.protocol}//${location.hostname}`;

  if (location.port) {
    origin += `:${location.port}`;
  }
  return url && url.indexOf(origin) === 0;
}
function sameOrigin ( url ) { let origin = ` ${ location . protocol } ${ location . hostname } ` ; if ( location . port ) { origin += ` ${ location . port } ` ; } return url && url . indexOf ( origin ) === 0 ; }
Check if 'url' is from same origin
@param {String} url
@returns {Boolean}
Check if url is from same origin