0.0.1 • Published 2 years ago

@zept/path-regexp v0.0.1

Weekly downloads
-
License
-
Repository
-
Last release
2 years ago

@zept/path-regexp

convert path to regexp

import { pathToRegexp } from '@zept/path-regexp';

pathToRegexp('/'); // { params: [], pattern: /^\/\/?$/i }
pathToRegexp('/hello'); // { params: [], pattern: /^\/hello\/?$/i }
pathToRegexp('/user/:user'); // { params: [ 'user' ], pattern: /^\/([^/]+?)\/?$/i }

License

MIT

0.0.1

2 years ago

0.0.0

2 years ago