Socket
Socket
Sign inDemoInstall

itty-router

Package Overview
Dependencies
Maintainers
1
Versions
265
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

itty-router - npm Package Compare versions

Comparing version 1.2.9 to 1.2.10

4

dist/itty-router.js

@@ -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)
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc