Created
September 5, 2018 00:04
-
-
Save stwilz/3c3170f10b2a04e3e6ae3df4bdfcab37 to your computer and use it in GitHub Desktop.
This file contains 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
const createUrl = (path, params = {}) => | |
`${Object.keys(params).reduce( | |
(url, key) => url.replace(`:${key}`, params[key]), | |
path, | |
)}`; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment