Created
February 24, 2016 15:01
-
-
Save ar45/c65d7a6f6b4d0543e2fb 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
| function interpolateUrl(url, params, replaceMissing) { | |
| return url.replace(/:([^\/]+)/g, (match, p1) => { | |
| return params[p1] || ( replaceMissing ? '' : match ); | |
| }); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment