url-constructor
Given a url with parameters defined by colons, we can match the key and replace it with values from an object:
const urlConstruct = const url = '/orders/:id'const id = 123 // '/orders/123'
Or a more complex situation with query params
const urlConstruct = const url = '/orders/:id?cancel=:cancel'const id = 123const cancel = true // '/orders/123?cancel=true'