New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

lambda-router

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

lambda-router - npm Package Compare versions

Comparing version 3.0.0-0 to 3.0.0-1

lib/main.js

1

lib/logger.js

@@ -8,2 +8,3 @@ "use strict";

const noop = () => { };
// eslint-disable-next-line @typescript-eslint/no-explicit-any
function wrapper(baseLogger) {

@@ -10,0 +11,0 @@ const logger = baseLogger || {};

14

lib/router.js

@@ -26,3 +26,3 @@ "use strict";

let unknownRouteHandler = defaultUnknownRoute;
let defaultHeaders = {
const defaultHeaders = {
'content-type': 'application/json',

@@ -42,7 +42,7 @@ };

let statusCode, body;
let requestHeaders = normalizeRequestHeaders(event.headers);
const requestHeaders = normalizeRequestHeaders(event.headers);
let headers = { ...defaultHeaders };
// Safety Checks
if (lambdaContext.response) {
let message = 'context.response has already been assigned. Lambda-router reserves this property for custom responses.';
const message = 'context.response has already been assigned. Lambda-router reserves this property for custom responses.';
logger.error(message);

@@ -112,3 +112,3 @@ return Promise.reject(new Error(message));

try {
for (let fn of middleware) {
for (const fn of middleware) {
await fn(event, context, requestPath, httpMethod);

@@ -167,3 +167,3 @@ }

function customResponse(context, { statusCode = 200, body, headers = {}, isBase64Encoded = false, }) {
let response = {
const response = {
[CUSTOM_RESPONSE]: true,

@@ -214,3 +214,3 @@ statusCode,

// If the part is a curly braces value
let pathPartMatch = /\{(\w+)}/g.exec(routePart);
const pathPartMatch = /\{(\w+)}/g.exec(routePart);
if (pathPartMatch) {

@@ -291,3 +291,3 @@ tokens[pathPartMatch[1]] = pathPart;

return true;
let headerParts = header.split(';');
const headerParts = header.split(';');
return headerParts.includes(value);

@@ -294,0 +294,0 @@ }

{
"name": "lambda-router",
"version": "3.0.0-0",
"version": "3.0.0-1",
"description": "A router to simplify AWS Lambda Functions.",
"main": "lib/router.js",
"main": "lib/main.js",
"typings": "lib/types/main.d.ts",
"files": [

@@ -7,0 +8,0 @@ "lib"

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