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

@middy/http-router

Package Overview
Dependencies
Maintainers
3
Versions
109
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@middy/http-router - npm Package Compare versions

Comparing version 4.4.3 to 4.5.0

9

index.js

@@ -21,3 +21,3 @@ import { createError } from '@middy/util';

return (event, context, abort)=>{
const { method , path } = getVersionRoute[event.version ?? '1.0']?.(event);
const { method , path } = getVersionRoute[pickVersion(event)]?.(event);
if (!method) {

@@ -84,2 +84,5 @@ throw new Error('[http-router] Unknown http event format');

};
const pickVersion = (event)=>{
return event.version ?? (event.method ? 'vpc' : '1.0');
};
const getVersionRoute = {

@@ -93,2 +96,6 @@ '1.0': (event)=>({

path: event.requestContext.http.path
}),
vpc: (event)=>({
method: event.method,
path: event.raw_path.split('?')[0]
})

@@ -95,0 +102,0 @@ };

8

package.json
{
"name": "@middy/http-router",
"version": "4.4.3",
"version": "4.5.0",
"description": "HTTP event router for the middy framework",

@@ -69,9 +69,9 @@ "type": "module",

"dependencies": {
"@middy/util": "4.4.3"
"@middy/util": "4.5.0"
},
"devDependencies": {
"@middy/core": "4.4.3",
"@middy/core": "4.5.0",
"@types/aws-lambda": "^8.10.97"
},
"gitHead": "089df92081ae593696c59fad7c604c2ac2eebe1a"
"gitHead": "200d1cd90c6e0bd25bb96c525cdebd1a74d813a6"
}

@@ -22,4 +22,5 @@ <div align="center">

</a>
<a href="https://lgtm.com/projects/g/middyjs/middy/context:javascript">
<img src="https://img.shields.io/lgtm/grade/javascript/g/middyjs/middy.svg?logo=lgtm&logoWidth=18" alt="Language grade: JavaScript" style="max-width:100%;">
<a href="https://github.com/middyjs/middy/actions/workflows/sast.yml">
<img src="https://github.com/middyjs/middy/actions/workflows/sast.yml/badge.svg
?branch=main&event=push" alt="CodeQL" style="max-width:100%;">
</a>

@@ -26,0 +27,0 @@ <a href="https://bestpractices.coreinfrastructure.org/projects/5280">

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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