Urara-Blog/node_modules/.pnpm-store/v3/files/bb/331b3af310f69b2175630ccd6ec9d697c97bba67bce1779e75995fd21a6ef443d1aac1f73d88e3cc8181aa344c9854ea00621e258d0930ef9a11038b36dbeb
2022-08-14 01:14:53 +08:00

18 lines
557 B
Text

/*
Copyright 2018 Google LLC
Use of this source code is governed by an MIT-style
license that can be found in the LICENSE file or at
https://opensource.org/licenses/MIT.
*/
import '../_version.js';
const getFriendlyURL = (url: URL | string): string => {
const urlObj = new URL(String(url), location.href);
// See https://github.com/GoogleChrome/workbox/issues/2323
// We want to include everything, except for the origin if it's same-origin.
return urlObj.href.replace(new RegExp(`^${location.origin}`), '');
};
export {getFriendlyURL};