lambda-proxy-utils
Advanced tools
Comparing version 2.1.3 to 2.1.4
{ | ||
"name": "lambda-proxy-utils", | ||
"version": "2.1.3", | ||
"version": "2.1.4", | ||
"description": "Lambda Proxy event helpers", | ||
@@ -42,6 +42,6 @@ "author": "Geoff Dutton <g.dutton@gmail.com>", | ||
"chai": "^4.2.0", | ||
"coveralls": "^3.0.3", | ||
"coveralls": "^3.0.6", | ||
"mocha": "^6.1.4", | ||
"nyc": "^14.0.0", | ||
"standard": "^12.0.1" | ||
"standard": "^13.1.0" | ||
}, | ||
@@ -48,0 +48,0 @@ "standard": { |
@@ -5,3 +5,3 @@ 'use strict' | ||
const typeis = require('type-is').is | ||
const urlParse = require('url').parse | ||
const urlParse = require('url').parse // eslint-disable-line node/no-deprecated-api | ||
const _toString = require('lodash.tostring') | ||
@@ -8,0 +8,0 @@ const cookie = require('cookie') |
@@ -54,5 +54,5 @@ 'use strict' | ||
if (typeof opts.headers === 'object') { | ||
for (const key in opts.headers) { | ||
Object.keys(opts.headers).forEach(key => { | ||
this.set(key, opts.headers[key]) | ||
} | ||
}) | ||
} | ||
@@ -138,3 +138,3 @@ | ||
// https://forums.aws.amazon.com/thread.jspa?threadID=205782 | ||
if (res.headers.hasOwnProperty(SET_COOKIE) && Array.isArray(res.headers[SET_COOKIE])) { | ||
if ({}.hasOwnProperty.call(res.headers, SET_COOKIE) && Array.isArray(res.headers[SET_COOKIE])) { | ||
const allCookes = res.headers['Set-Cookie'] | ||
@@ -241,11 +241,9 @@ res.headers[SET_COOKIE] = allCookes.shift() | ||
if (arguments.length === 2) { | ||
const value = Array.isArray(val) | ||
this.headers[field.toLowerCase()] = Array.isArray(val) | ||
? val.map(_toString) | ||
: _toString(val) | ||
this.headers[field.toLowerCase()] = value | ||
} else { | ||
for (const key in field) { | ||
Object.keys(field).forEach(key => { | ||
this.set(key, field[key]) | ||
} | ||
}) | ||
} | ||
@@ -252,0 +250,0 @@ return this |
26262
622