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

@fastify/aws-lambda

Package Overview
Dependencies
Maintainers
20
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@fastify/aws-lambda - npm Package Compare versions

Comparing version 4.0.0 to 4.1.0

12

index.js

@@ -20,2 +20,3 @@ 'use strict'

options.pathParameterUsedAsPath = options.pathParameterUsedAsPath !== undefined ? options.pathParameterUsedAsPath : false
options.parseCommaSeparatedQueryParams = options.parseCommaSeparatedQueryParams !== undefined ? options.parseCommaSeparatedQueryParams : true
let currentAwsArguments = {}

@@ -52,2 +53,3 @@ if (options.decorateRequest) {

const query = {}
const parsedCommaSeparatedQuery = {}
if (event.requestContext && event.requestContext.elb) {

@@ -61,4 +63,4 @@ if (event.multiValueQueryStringParameters) {

query[decodeURIComponent(q)] = decodeURIComponent(event.queryStringParameters[q])
if (event.version === '2.0' && typeof query[decodeURIComponent(q)] === 'string' && query[decodeURIComponent(q)].indexOf(',') > 0) {
query[decodeURIComponent(q)] = query[decodeURIComponent(q)].split(',')
if (options.parseCommaSeparatedQueryParams && event.version === '2.0' && typeof query[decodeURIComponent(q)] === 'string' && query[decodeURIComponent(q)].indexOf(',') > 0) {
parsedCommaSeparatedQuery[decodeURIComponent(q)] = query[decodeURIComponent(q)].split(',')
}

@@ -68,10 +70,10 @@ })

} else {
if (event.queryStringParameters && event.version === '2.0') {
if (event.queryStringParameters && options.parseCommaSeparatedQueryParams && event.version === '2.0') {
Object.keys(event.queryStringParameters).forEach((k) => {
if (typeof event.queryStringParameters[k] === 'string' && event.queryStringParameters[k].indexOf(',') > 0) {
event.queryStringParameters[k] = event.queryStringParameters[k].split(',')
parsedCommaSeparatedQuery[decodeURIComponent(k)] = event.queryStringParameters[k].split(',')
}
})
}
Object.assign(query, event.multiValueQueryStringParameters || event.queryStringParameters)
Object.assign(query, event.multiValueQueryStringParameters || event.queryStringParameters, parsedCommaSeparatedQuery)
}

@@ -78,0 +80,0 @@ const headers = Object.assign({}, event.headers)

@@ -29,3 +29,3 @@ {

"license": "MIT",
"version": "4.0.0",
"version": "4.1.0",
"main": "index.js",

@@ -44,6 +44,6 @@ "type": "commonjs",

"devDependencies": {
"@fastify/multipart": "8.1.0",
"@fastify/multipart": "8.2.0",
"@fastify/pre-commit": "^2.1.0",
"@types/aws-lambda": "8.10.131",
"aws-lambda": "^1.0.7",
"@h4ad/serverless-adapter": "4.2.1",
"@types/aws-lambda": "8.10.137",
"aws-serverless-express": "^3.4.0",

@@ -58,10 +58,10 @@ "aws-serverless-fastify": "^3.0.6",

"eslint-plugin-standard": "^5.0.0",
"fastify": "^4.25.2",
"fastify": "^4.26.0",
"serverless-http": "^3.2.0",
"tap": "^16.3.9",
"tsd": "^0.30.4"
"tsd": "^0.31.0"
},
"overrides": {
"aws-serverless-fastify": {
"fastify": "^4.25.2"
"fastify": "^4.26.0"
}

@@ -68,0 +68,0 @@ },

@@ -11,3 +11,3 @@ # Introduction

**Seems [faster](https://github.com/fastify/aws-lambda-fastify#some-basic-performance-metrics)** *(as the name implies)* **than [aws-serverless-express](https://github.com/awslabs/aws-serverless-express) and [aws-serverless-fastify](https://github.com/benMain/aws-serverless-fastify) 😉**
**Seems [faster](https://github.com/fastify/aws-lambda-fastify#%EF%B8%8Fsome-basic-performance-metrics)** *(as the name implies)* **than [aws-serverless-express](https://github.com/awslabs/aws-serverless-express) and [aws-serverless-fastify](https://github.com/benMain/aws-serverless-fastify) 😉**

@@ -34,3 +34,3 @@ ## 👨🏻‍💻Installation

| pathParameterUsedAsPath | Use a defined pathParameter as path (i.e. `'proxy'`) | `false` |
| parseCommaSeparatedQueryParams | Parse querystring with commas into an array of values. Affects the behavior of the querystring parser with commas while using [Payload Format Version 2.0](https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-integrations-lambda.html#http-api-develop-integrations-lambda.proxy-format) | `true` |
## 📖Example

@@ -148,3 +148,3 @@

- API Gateway has a timeout of 29 seconds, and Lambda has a maximum execution time of 15 minutes. (Using Application Load Balancer has no timeout limit, so the lambda maximum execution time is relevant)
- If you are using another web framework beside Fastify (i.e. Connect, Express, Koa, Restana, Sails, Hapi, Restify) or want to use a more generic serverless proxy framework, have a look at: [serverless-http](https://github.com/dougmoscrop/serverless-http)
- If you are using another web framework beside Fastify (i.e. Connect, Express, Koa, Restana, Sails, Hapi, Restify) or want to use a more generic serverless proxy framework, have a look at: [serverless-http](https://github.com/dougmoscrop/serverless-http) or [serverless-adapter](https://github.com/H4ad/serverless-adapter)

@@ -151,0 +151,0 @@

@@ -19,2 +19,12 @@ import { Context } from "aws-lambda";

pathParameterUsedAsPath?: string;
/**
* Parse querystring with commas into an array of values.
* Affects the behavior of the querystring parser with commas while using [Payload Format Version 2.0](https://docs.aws.amazon.com/apigateway/latest/developerguide/http-api-develop-integrations-lambda.html#http-api-develop-integrations-lambda.proxy-format)
*
* e.g. when set to `true` (default) `?foo=qux,bar` => `{ foo: ['qux', 'bar'] }`
*
* e.g. when set to `false` `?foo=qux,bar` => `{ foo: 'qux,bar' }`
* @default true
*/
parseCommaSeparatedQueryParams?: boolean;
}

@@ -21,0 +31,0 @@

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