|
Last change
on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 12 days ago |
|
Fix frontend appearance
|
-
Property mode
set to
100644
|
|
File size:
615 bytes
|
| Rev | Line | |
|---|
| [9af201e] | 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 | */
|
|---|
| 8 |
|
|---|
| 9 | import '../_version.js';
|
|---|
| 10 |
|
|---|
| 11 | /**
|
|---|
| 12 | * Returns true if two URLs have the same `.href` property. The URLS can be
|
|---|
| 13 | * relative, and if they are the current location href is used to resolve URLs.
|
|---|
| 14 | *
|
|---|
| 15 | * @private
|
|---|
| 16 | * @param {string} url1
|
|---|
| 17 | * @param {string} url2
|
|---|
| 18 | * @return {boolean}
|
|---|
| 19 | */
|
|---|
| 20 | export function urlsMatch(url1: string, url2: string): boolean {
|
|---|
| 21 | const {href} = location;
|
|---|
| 22 | return new URL(url1, href).href === new URL(url2, href).href;
|
|---|
| 23 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.