Socket
Socket
Sign inDemoInstall

itty-router

Package Overview
Dependencies
Maintainers
2
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.4.2 to 1.4.3

3

CHANGELOG.md
## Changelog
Until this library makes it to a production release of v1.x, **minor versions may contain breaking changes to the API**. After v1.x, semantic versioning will be honored, and breaking changes will only occur under the umbrella of a major version bump.
- **v1.4.3** - fixed nested routers using simple "/" routes
- **v1.4.1** - fixed typings for extra args (thanks [@rodrigoaddor](https://github.com/rodrigoaddor))

@@ -16,2 +17,2 @@ - **v1.4.0** - adds support for optional format params (e.g. "/:id.:format?" --> { params: { id: '13', format: 'jpg' }})

- **v0.6.0** - added types to project for vscode intellisense (thanks [@mvasigh](https://github.com/mvasigh))
- **v0.5.4** - fix: wildcard routes properly supported
- **v0.5.4** - fix: wildcard routes properly supported

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

.replace(/(\/?)\*/g, '($1.*)?')
.replace(/\/$/, '')
.replace(/:([^\/\?\.]+)(\?)?/g, '$2(?<$1>[^/\.]+)$2')
}\/?$`,
}\/*$`,
hs

@@ -24,0 +25,0 @@ ]) && c

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

const e=(e={})=>new Proxy(e,{get:(r,a,o)=>"handle"===a?async(e,...a)=>{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,...a)))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};
const e=(e={})=>new Proxy(e,{get:(r,a,o)=>"handle"===a?async(e,...a)=>{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,...a)))return s}:(s,...t)=>(r[a]=r[a]||[]).push([`^${(e.base||"")+s.replace(/(\/?)\*/g,"($1.*)?").replace(/\/$/,"").replace(/:([^\/\?\.]+)(\?)?/g,"$2(?<$1>[^/.]+)$2")}/*$`,t])&&o});module.exports={Router:e};
{
"name": "itty-router",
"version": "1.4.2",
"version": "1.4.3",
"description": "Tiny, zero-dependency router with route param and query parsing.",

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

@@ -179,4 +179,5 @@ ![Logo][logo-image]

.replace(/(\/?)\*/g, '($1.*)?')
.replace(/:([^\/\?]+)(\?)?/g, '$2(?<$1>[^/]+)$2')
}\/?$`,
.replace(/\/$/, '')
.replace(/:([^\/\?\.]+)(\?)?/g, '$2(?<$1>[^/\.]+)$2')
}\/*$`,
hs

@@ -183,0 +184,0 @@ ]) && c

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