@maruware/path-params
v0.0.5
Published
Build URL with path params
Downloads
3
Readme
path-params
Build URL with path params
Install
yarn add @maruware/path-params
Usage
import pathParams from '@maruware/path-params'
const path = pathParams('/users/:id/messages/:message_id', {id: 2, message_id: 'abc'})
// '/users/2/messages/abc'
- with transform to snake case
import pathParams from '@maruware/path-params'
const path = pathParams('/users/:id/messages/:message_id', {id: 2, messageId: 'abc'}, {toSnake: true})
// '/users/2/messages/abc'