source: frontend/node_modules/workbox-window/utils/urlsMatch.js

Last change on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 13 days ago

Fix frontend appearance

  • Property mode set to 100644
File size: 594 bytes
Line 
1/*
2 Copyright 2019 Google LLC
3
4 Use of this source code is governed by an MIT-style
5 license that can be found in the LICENSE file or at
6 https://opensource.org/licenses/MIT.
7*/
8import '../_version.js';
9/**
10 * Returns true if two URLs have the same `.href` property. The URLS can be
11 * relative, and if they are the current location href is used to resolve URLs.
12 *
13 * @private
14 * @param {string} url1
15 * @param {string} url2
16 * @return {boolean}
17 */
18export function urlsMatch(url1, url2) {
19 const { href } = location;
20 return new URL(url1, href).href === new URL(url2, href).href;
21}
Note: See TracBrowser for help on using the repository browser.