url-router
Advanced tools
Comparing version 11.0.2 to 11.0.3
{ | ||
"name": "url-router", | ||
"version": "11.0.2", | ||
"version": "11.0.3", | ||
"description": "A Trie-based router", | ||
@@ -26,7 +26,7 @@ "main": "dist/URLRouter", | ||
"devDependencies": { | ||
"@babel/core": "^7.8.0", | ||
"@babel/preset-env": "^7.8.2", | ||
"@babel/core": "^7.8.7", | ||
"@babel/preset-env": "^7.8.7", | ||
"eslint": "^6.8.0", | ||
"eslint-config-enough": "^0.3.8", | ||
"rollup": "^1.29.0", | ||
"rollup": "^1.32.0", | ||
"rollup-plugin-babel": "^4.3.3" | ||
@@ -33,0 +33,0 @@ }, |
@@ -130,4 +130,4 @@ # url-router | ||
const router = new Router() | ||
router.add('/people/:username/articles/:articleId(\\d+)', handler) | ||
const result = router.find('/people/johnsmith/articles/123') | ||
router.add('/people/:username/:year(\\d+)-:month(\\d+)/:articleId(\\d+)', handler) | ||
const result = router.find('/people/johnsmith/2020-02/123') | ||
/* | ||
@@ -139,2 +139,4 @@ result: | ||
username: 'johnsmith', | ||
year: '2020', | ||
month: '02, | ||
articleId: '123' | ||
@@ -141,0 +143,0 @@ } |
Sorry, the diff of this file is not supported yet
16167
197
439