Created
April 10, 2018 17:29
-
-
Save ZhihaoLau/c152a0a35ef6f11f32f9e5716d494352 to your computer and use it in GitHub Desktop.
Revisions
-
ZhihaoLau created this gist
Apr 10, 2018 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,17 @@ export function parseUrl(url) { let a = document.createElement('a') a.href = url return { href: a.href, protocol: a.protocol, host: a.host, hostname: a.hostname, port: a.port, pathname: a.pathname, search: a.search, hash: a.hash, origin: a.origin } }