query-dynamic-params
v1.0.1
Published
Query dynamic params
Downloads
3
Readme
query-dynamic-params
JavaScript/Typescript util for querying dynamic/named params
Installation
npm install query-dynamic-params
Usage
import { queryDynamicParams } from 'query-dynamic-params';
const url = '/users/:id/:name';
const path = '/users/1/john';
const params = queryDynamicParams(url, path, ['id', 'name']);
console.log(params); // { id: '1', name: 'john' }
Build
npm run build
Test
npm run test
License
MIT