We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c8f4cc8 commit 2d3700dCopy full SHA for 2d3700d
1 file changed
lib/index.js
@@ -251,15 +251,15 @@ function translateLambdaResultIfNeeded(result, isV1) {
251
return result;
252
}
253
254
- if (!result.statusCode && (typeof result === 'object' || typeof result === 'string')) {
+ if ((!result || !result.statusCode) && (typeof result === 'object' || typeof result === 'string' || typeof result === 'undefined')) {
255
return {
256
- "isBase64Encoded": false,
257
- "statusCode": 200,
258
- "body": JSON.stringify(result),
259
- "headers": {
260
- "content-type": "application/json"
+ isBase64Encoded: false,
+ statusCode: 200,
+ body: typeof result === 'undefined' ? undefined : JSON.stringify(result),
+ headers: {
+ 'content-type': 'application/json'
261
262
- }
+ };
263
264
265
return result || {};
0 commit comments