@middy/util
Advanced tools
Comparing version 2.0.0-alpha.5 to 2.0.0-alpha.6
18
index.js
@@ -161,2 +161,17 @@ "use strict"; | ||
const normalizeHttpResponse = (response, fallbackResponse = {}) => { | ||
var _response, _response$headers, _response2; | ||
response = (_response = response) !== null && _response !== void 0 ? _response : fallbackResponse; // May require updating to catch other types | ||
if (Array.isArray(response) || typeof response !== 'object') { | ||
response = { | ||
body: response | ||
}; | ||
} | ||
response.headers = (_response$headers = (_response2 = response) === null || _response2 === void 0 ? void 0 : _response2.headers) !== null && _response$headers !== void 0 ? _response$headers : {}; | ||
return response; | ||
}; | ||
module.exports = { | ||
@@ -171,3 +186,4 @@ createPrefetchClient, | ||
clearCache, | ||
jsonSafeParse | ||
jsonSafeParse, | ||
normalizeHttpResponse | ||
}; |
{ | ||
"name": "@middy/util", | ||
"version": "2.0.0-alpha.5", | ||
"version": "2.0.0-alpha.6", | ||
"description": "🛵 The stylish Node.js middleware engine for AWS Lambda (util package)", | ||
@@ -47,3 +47,3 @@ "type": "commonjs", | ||
"homepage": "https://github.com/middyjs/middy#readme", | ||
"gitHead": "2e69ea2322abcdcf88adde11fda4d04e4c038b54" | ||
"gitHead": "e6ab94a1f33ca215f63ee613bc9469ccd56caf21" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
9232
147