Created
December 21, 2018 16:44
-
-
Save developit/5503a67f63eb276c10bbc66a1dc56b32 to your computer and use it in GitHub Desktop.
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
module.exports = { | |
format(parts) { | |
return new URL(parts).href; | |
}, | |
parse(url) { | |
const parsed = new URL(url); | |
parsed.query = parsed.search ? parsed.search.substring(1) : null; | |
parsed.auth = parsed.username + ':' + parsed.password; | |
return parsed; | |
}, | |
resolve(from, to) { | |
return new URL(to, from).href; | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment