Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@aseifu/cloudflare-router

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aseifu/cloudflare-router - npm Package Compare versions

Comparing version 1.0.3 to 1.0.4

9

index.ts

@@ -8,3 +8,3 @@

interface CustomRequest extends Request {
params?: Params;
params: Params;
}

@@ -20,3 +20,3 @@

const parseRoute = (route: string, url: string): { matched: boolean, params?: Params } => {
const parseRoute = (route: string, url: string): { matched: boolean, params: Params } => {
const routePattern = new RegExp('^' + route.replace(/:\w+/g, '([^/]+)') + '$');

@@ -35,3 +35,3 @@ const match = url.match(routePattern);

return { matched: false };
return { matched: false, params: {} };
};

@@ -81,4 +81,3 @@

if (isMatched) {
let customRequest: CustomRequest= request;
customRequest.params = params;
let customRequest: CustomRequest= { ...request, params};
matched = true;

@@ -85,0 +84,0 @@ callback(customRequest, res);

{
"name": "@aseifu/cloudflare-router",
"version": "1.0.3",
"version": "1.0.4",
"description": "A lightweight routing utility for Cloudflare Workers, enabling easy management of HTTP routes with support for dynamic URL parameters.",

@@ -5,0 +5,0 @@ "main": "index.ts",

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