itty-router
Advanced tools
Comparing version 1.2.9 to 1.2.10
@@ -20,4 +20,4 @@ const Router = (o = {}) => | ||
.replace(/(\/?)\*/g, '($1.*)?') | ||
.replace(/(\/:([^\/\?]+)(\?)?)/g, '/$3(?<$2>[^/]+)$3') | ||
}$`, | ||
.replace(/:([^\/\?]+)(\?)?/g, '$2(?<$1>[^/]+)$2') | ||
}\/?$`, | ||
hs | ||
@@ -24,0 +24,0 @@ ]) && c |
@@ -1,1 +0,1 @@ | ||
const e=(e={})=>new Proxy(e,{get:(r,a,o)=>"handle"===a?async e=>{for([p,hs]of r[(e.method||"GET").toLowerCase()]||[])if(m=(u=new URL(e.url)).pathname.match(p))for(h of(e.params=m.groups,e.query=Object.fromEntries(u.searchParams.entries()),hs))if(void 0!==(s=await h(e)))return s}:(s,...t)=>(r[a]=r[a]||[]).push([`^${(e.base||"")+s.replace(/(\/?)\*/g,"($1.*)?").replace(/(\/:([^\/\?]+)(\?)?)/g,"/$3(?<$2>[^/]+)$3")}$`,t])&&o});module.exports={Router:e}; | ||
const e=(e={})=>new Proxy(e,{get:(r,a,o)=>"handle"===a?async e=>{for([p,hs]of r[(e.method||"GET").toLowerCase()]||[])if(m=(u=new URL(e.url)).pathname.match(p))for(h of(e.params=m.groups,e.query=Object.fromEntries(u.searchParams.entries()),hs))if(void 0!==(s=await h(e)))return s}:(s,...t)=>(r[a]=r[a]||[]).push([`^${(e.base||"")+s.replace(/(\/?)\*/g,"($1.*)?").replace(/:([^\/\?]+)(\?)?/g,"$2(?<$1>[^/]+)$2")}/?$`,t])&&o});module.exports={Router:e}; |
{ | ||
"name": "itty-router", | ||
"version": "1.2.9", | ||
"version": "1.2.10", | ||
"description": "Tiny, zero-dependency router with route param and query parsing.", | ||
@@ -5,0 +5,0 @@ "main": "./dist/itty-router.min.js", |
@@ -120,3 +120,3 @@ ![Logo][logo-image] | ||
.get('/foo/:id', ({ params }) => new Response(`Details for item ${params.id}.`)) | ||
.get('*', () => new Response('Not Found.', { status: 404 }) | ||
.get('*', () => new Response('Not Found.', { status: 404 })) | ||
@@ -242,1 +242,9 @@ // attach the router handle to the event handler | ||
[coveralls-url]:https://coveralls.io/github/kwhitley/itty-router?branch=v1.x | ||
# Contributors | ||
These folks are the real heroes, making open source the powerhouse that it is! Help us out and add your name to this list! | ||
#### Core, Concepts, and Codebase | ||
- [@mvasigh](https://github.com/mvasigh) | ||
#### Documentation Fixes | ||
- [@arunsathiya](https://github.com/arunsathiya) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
15715
249