Socket
Socket
Sign inDemoInstall

itty-router

Package Overview
Dependencies
0
Maintainers
2
Versions
264
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.0.0 to 2.0.1

6

dist/itty-router.js

@@ -5,3 +5,3 @@ const Router = (o = {}) =>

? async (r, ...args) => {
for ([, p, hs] of t.r.filter(r => r[0] === r.method || 'ALL')) {
for ([p, hs] of t.r.filter(r => r[0] === r.method || 'ALL')) {
if (m = (u = new URL(r.url)).pathname.match(p)) {

@@ -19,3 +19,2 @@ r.params = m.groups

(t.r = t.r || []).push([
k.toUpperCase(),
`^${(t.base || '')+p

@@ -26,3 +25,4 @@ .replace(/(\/?)\*/g, '($1.*)?')

}\/*$`,
hs
hs,
k.toUpperCase(),
]) && c

@@ -29,0 +29,0 @@ })

@@ -1,1 +0,1 @@

const e=(e={})=>new Proxy(e,{get:(e,r,a)=>"handle"===r?async(r,...a)=>{for([,p,hs]of e.r.filter((e=>e[0]===e.method||"ALL")))if(m=(u=new URL(r.url)).pathname.match(p))for(h of(r.params=m.groups,r.query=Object.fromEntries(u.searchParams.entries()),hs))if(void 0!==(s=await h(r,...a)))return s}:(s,...o)=>(e.r=e.r||[]).push([r.toUpperCase(),`^${(e.base||"")+s.replace(/(\/?)\*/g,"($1.*)?").replace(/\/$/,"").replace(/:([^\/\?\.]+)(\?)?/g,"$2(?<$1>[^/.]+)$2")}/*$`,o])&&a});module.exports={Router:e};
const e=(e={})=>new Proxy(e,{get:(e,r,a)=>"handle"===r?async(r,...a)=>{for([p,hs]of e.r.filter((e=>e[0]===e.method||"ALL")))if(m=(u=new URL(r.url)).pathname.match(p))for(h of(r.params=m.groups,r.query=Object.fromEntries(u.searchParams.entries()),hs))if(void 0!==(s=await h(r,...a)))return s}:(s,...o)=>(e.r=e.r||[]).push([`^${(e.base||"")+s.replace(/(\/?)\*/g,"($1.*)?").replace(/\/$/,"").replace(/:([^\/\?\.]+)(\?)?/g,"$2(?<$1>[^/.]+)$2")}/*$`,o,r.toUpperCase()])&&a});module.exports={Router:e};
{
"name": "itty-router",
"version": "2.0.0",
"version": "2.0.1",
"description": "Tiny, zero-dependency router with route param and query parsing.",

@@ -5,0 +5,0 @@ "main": "./dist/itty-router.min.js",

SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc