Skip to content

Commit

Permalink
refactor: remove var
Browse files Browse the repository at this point in the history
  • Loading branch information
dnalborczyk committed Jul 9, 2022
1 parent c1552e4 commit 5f84931
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/events/http/HttpServer.js
Original file line number Diff line number Diff line change
Expand Up @@ -778,11 +778,11 @@ export default class HttpServer {
const { responseParameters } = chosenResponse

if (responseParameters) {
const responseParametersKeys = keys(responseParameters)

log.debug('_____ RESPONSE PARAMETERS PROCCESSING _____')
log.debug(
`Found ${responseParametersKeys.length} responseParameters for '${responseName}' response`,
`Found ${
keys(responseParameters).length
} responseParameters for '${responseName}' response`,
)

// responseParameters use the following shape: "key": "value"
Expand Down Expand Up @@ -872,9 +872,7 @@ export default class HttpServer {
const { responseTemplates } = chosenResponse

if (typeof responseTemplates === 'object') {
const responseTemplatesKeys = keys(responseTemplates)

if (responseTemplatesKeys.length) {
if (keys(responseTemplates).length) {
// BAD IMPLEMENTATION: first key in responseTemplates
const responseTemplate = responseTemplates[responseContentType]

Expand Down Expand Up @@ -965,6 +963,7 @@ export default class HttpServer {
response.statusCode = statusCode

const headers = {}

if (result && result.headers) {
keys(result.headers).forEach((header) => {
headers[header] = (headers[header] || []).concat(
Expand Down

0 comments on commit 5f84931

Please sign in to comment.