Replaces Express URL pattern with regular URL.
npm install @economia/compose-url --save
import { composeURL } from '@economia/compose-url'
const { composeURL } = require('@economia/compose-url')
const pattern = '/users/:id'
const params = { id: 42 }
const URL = composeURL(pattern, params)
// /users/42
const pattern = '/users/:id'
const params = {}
const URL = composeURL(pattern, params)
// error
Optional parameters end with "?" and can be omitted
const pattern = '/users/:id?'
const params = { id: 42 }
const URL = composeURL(pattern, params)
// /users/42
const pattern = '/users/:id?'
const params = {}
const URL = composeURL(pattern, params)
// /users