Created
March 29, 2020 14:51
-
-
Save pinkhominid/deb7494a4a47c08128b687407505a508 to your computer and use it in GitHub Desktop.
Are URL Origins Equal?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export function areUrlOriginsEqual(url1, url2) { | |
const u1 = new URL(url1); | |
const u2 = new URL(url2); | |
return u1.origin === u2.origin; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment