@jswork/next-path-match
v1.0.2
Published
A wrapper for path-to-regexp.
Downloads
30
Readme
next-path-match
A wrapper for path-to-regexp.
installation
npm install -S @jswork/next-path-match
usage
import '@jswork/next-path-match';
const res = nx.pathMatch(
'/dashboard/self-analysis/:type/:id',
'/dashboard/self-analysis/folder/13'
);
// result:
{
type:'folder',
id:'13'
}
options
| name | default | description |
| ------------ | -------------- | -------------------------------------------- |
| replacements | [['?', '\?']] | Replace for pre process route. |
| completion | both | Will completion route(both/left/right/none
). |
resources
- https://github.com/pillarjs/path-to-regexp
license
Code released under the MIT license.