Package Exports
- @economia/compose-url
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@economia/compose-url) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Compose url
Replaces Express URL pattern with regular URL.
Install
npm install @economia/compose-url --saveES6 import
import { composeURL } from '@economia/compose-url'Common js import
const { composeURL } = require('@economia/compose-url')Example:
const pattern = '/users/:id'
const params = { id: 42 }
const URL = composeURL(pattern, params)
// /users/42const pattern = '/users/:id'
const params = {}
const URL = composeURL(pattern, params)
// errorOptional parameters end with "?" and can be omitted
const pattern = '/users/:id?'
const params = { id: 42 }
const URL = composeURL(pattern, params)
// /users/42const pattern = '/users/:id?'
const params = {}
const URL = composeURL(pattern, params)
// /users