resolve-api-handler-awslambda
Advanced tools
Comparing version
@@ -16,2 +16,3 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; } | ||
const INTERNAL = Symbol('INTERNAL'); | ||
const isTrailingBracket = /\[\]$/; | ||
@@ -63,3 +64,3 @@ const normalizeKey = (key, mode) => { | ||
}, | ||
queryStringParameters, | ||
multiValueQueryStringParameters, | ||
body | ||
@@ -90,4 +91,13 @@ } = lambdaEvent, | ||
const req = Object.create(null); | ||
const query = queryStringParameters != null ? queryStringParameters : {}; | ||
const query = multiValueQueryStringParameters != null ? multiValueQueryStringParameters : {}; | ||
for (const [queryKey, queryValue] of Object.entries(query)) { | ||
if (isTrailingBracket.test(queryKey)) { | ||
delete query[queryKey]; | ||
query[queryKey.replace(isTrailingBracket, '')] = queryValue; | ||
} else if (queryValue.length === 1) { | ||
query[queryKey] = queryValue[0]; | ||
} | ||
} | ||
const reqProperties = _objectSpread({ | ||
@@ -94,0 +104,0 @@ adapter: 'awslambda', |
@@ -28,2 +28,3 @@ "use strict"; | ||
const INTERNAL = Symbol('INTERNAL'); | ||
const isTrailingBracket = /\[\]$/; | ||
@@ -75,3 +76,3 @@ const normalizeKey = (key, mode) => { | ||
}, | ||
queryStringParameters, | ||
multiValueQueryStringParameters, | ||
body | ||
@@ -102,4 +103,13 @@ } = lambdaEvent, | ||
const req = Object.create(null); | ||
const query = queryStringParameters != null ? queryStringParameters : {}; | ||
const query = multiValueQueryStringParameters != null ? multiValueQueryStringParameters : {}; | ||
for (const [queryKey, queryValue] of Object.entries(query)) { | ||
if (isTrailingBracket.test(queryKey)) { | ||
delete query[queryKey]; | ||
query[queryKey.replace(isTrailingBracket, '')] = queryValue; | ||
} else if (queryValue.length === 1) { | ||
query[queryKey] = queryValue[0]; | ||
} | ||
} | ||
const reqProperties = _objectSpread({ | ||
@@ -106,0 +116,0 @@ adapter: 'awslambda', |
{ | ||
"name": "resolve-api-handler-awslambda", | ||
"version": "0.23.0", | ||
"version": "0.23.1", | ||
"description": "An AWS Lambda adapter for reSolve API handlers.", | ||
@@ -5,0 +5,0 @@ "engines": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
61678
4.22%495
3.77%