@maruware/path-params
TypeScript icon, indicating that this package has built-in type declarations

0.0.5 • Public • Published

path-params

Typed with TypeScript Build Status

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'

Readme

Keywords

none

Package Sidebar

Install

npm i @maruware/path-params

Weekly Downloads

0

Version

0.0.5

License

MIT

Unpacked Size

3.34 kB

Total Files

7

Last publish

Collaborators

  • maruware