Socket
Socket
Sign inDemoInstall

middy

Package Overview
Dependencies
40
Maintainers
8
Versions
147
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.33.2 to 0.34.0

README.md.hb

6

CHANGELOG.md

@@ -1,5 +0,9 @@

# Middy changelog
# Middy 0.x changelog
## 0.34.0
- `[BC]` Dropped support for Node.js 6 and added support for Node.js 10 and 12.
## 0.22.0
- `[BC]` Removed Function Shield middleware from core. You can now install function shield from [`@middy/function-shield`](https://www.npmjs.com/package/@middy/function-shield)

44

package.json
{
"name": "middy",
"version": "0.33.2",
"version": "0.34.0",
"description": "🛵 The stylish Node.js middleware engine for AWS Lambda",

@@ -46,32 +46,32 @@ "main": "./index.js",

"devDependencies": {
"@types/jest": "^24.0.5",
"@types/node": "^10.14.12",
"aws-sdk": "^2.437.0",
"babel-jest": "^24.1.0",
"@types/jest": "^25.1.3",
"@types/node": "^13.7.7",
"aws-sdk": "^2.630.0",
"babel-jest": "^25.1.0",
"babel-preset-env": "^1.7.0",
"codecov": "^3.2.0",
"eslint": "^5.14.0",
"eslint-config-standard": "^12.0.0",
"eslint-plugin-import": "^2.16.0",
"eslint-plugin-node": "^8.0.1",
"eslint-plugin-promise": "^4.0.1",
"eslint-plugin-standard": "^4.0.0",
"husky": "^1.1.0",
"jest": "^24.8.0",
"codecov": "^3.6.5",
"eslint": "^6.8.0",
"eslint-config-standard": "^14.1.0",
"eslint-plugin-import": "^2.20.1",
"eslint-plugin-node": "^11.0.0",
"eslint-plugin-promise": "^4.2.1",
"eslint-plugin-standard": "^4.0.1",
"husky": "^4.2.3",
"jest": "^25.1.0",
"jsdoc": "^3.6.3",
"jsdoc-to-markdown": "^5.0.0",
"marked": "^0.7.0",
"regenerator-runtime": "^0.13.1",
"typescript": "^3.3.3",
"jsdoc-to-markdown": "^5.0.3",
"marked": "^0.8.0",
"regenerator-runtime": "^0.13.3",
"typescript": "^3.8.3",
"typings-tester": "^0.3.2"
},
"dependencies": {
"@types/aws-lambda": "^8.10.19",
"@types/http-errors": "^1.6.1",
"@types/aws-lambda": "^8.10.45",
"@types/http-errors": "^1.6.3",
"ajv": "^6.9.1",
"ajv-i18n": "^3.4.0",
"ajv-keywords": "^3.4.0",
"ajv-keywords": "^3.4.1",
"busboy": "^0.3.1",
"content-type": "^1.0.4",
"http-errors": "^1.7.1",
"http-errors": "^1.7.3",
"json-mask": "^0.3.8",

@@ -78,0 +78,0 @@ "negotiator": "^0.6.1",

@@ -40,3 +40,3 @@ <div align="center">

⚠️ **Warining: Middy 0.x is being deprecated** ⚠️
⚠️ **Warning: Middy 0.x is being deprecated** ⚠️

@@ -43,0 +43,0 @@ Middy 1.x, with support for Node.js 10 & 12 will soon replace Middy 0.x.

@@ -11,3 +11,3 @@ const defaults = {

if (options.origins && options.origins.length > 0) {
if (handler.event.headers.hasOwnProperty('Origin') && options.origins.includes(handler.event.headers.Origin)) {
if (Object.prototype.hasOwnProperty.call(handler.event.headers, 'Origin') && options.origins.includes(handler.event.headers.Origin)) {
return handler.event.headers.Origin

@@ -18,3 +18,3 @@ } else {

} else {
if (handler.event.headers.hasOwnProperty('Origin') && options.credentials && options.origin === '*') {
if (Object.prototype.hasOwnProperty.call(handler.event.headers, 'Origin') && options.credentials && options.origin === '*') {
return handler.event.headers.Origin

@@ -29,3 +29,3 @@ }

if (handler.event.hasOwnProperty('httpMethod')) {
if (Object.prototype.hasOwnProperty.call(handler.event, 'httpMethod')) {
handler.response = handler.response || {}

@@ -35,3 +35,3 @@ handler.response.headers = handler.response.headers || {}

// Check if already setup Access-Control-Allow-Headers
if (options.headers !== null && !handler.response.headers.hasOwnProperty('Access-Control-Allow-Headers')) {
if (options.headers !== null && !Object.prototype.hasOwnProperty.call(handler.response.headers, 'Access-Control-Allow-Headers')) {
handler.response.headers['Access-Control-Allow-Headers'] = options.headers

@@ -41,3 +41,3 @@ }

// Check if already setup the header Access-Control-Allow-Credentials
if (handler.response.headers.hasOwnProperty('Access-Control-Allow-Credentials')) {
if (Object.prototype.hasOwnProperty.call(handler.response.headers, 'Access-Control-Allow-Credentials')) {
options.credentials = JSON.parse(handler.response.headers['Access-Control-Allow-Credentials'])

@@ -50,3 +50,3 @@ }

// Check if already setup the header Access-Control-Allow-Origin
if (!handler.response.headers.hasOwnProperty('Access-Control-Allow-Origin')) {
if (!Object.prototype.hasOwnProperty.call(handler.response.headers, 'Access-Control-Allow-Origin')) {
handler.response.headers['Access-Control-Allow-Origin'] = getOrigin(options, handler)

@@ -53,0 +53,0 @@ }

@@ -5,3 +5,3 @@ module.exports = () => ({

if (event.hasOwnProperty('httpMethod')) {
if (Object.prototype.hasOwnProperty.call(event, 'httpMethod')) {
event.queryStringParameters = event.queryStringParameters || {}

@@ -8,0 +8,0 @@ event.multiValueQueryStringParameters = event.multiValueQueryStringParameters || {}

@@ -40,3 +40,3 @@ const BusBoy = require('busboy')

const parseMultipartData = (event, options) => {
let multipartData = {}
const multipartData = {}
const bb = BusBoy(Object.assign({}, options, { headers: event.headers }))

@@ -47,3 +47,3 @@

.on('file', (fieldname, file, filename, encoding, mimetype) => {
let attachment = {
const attachment = {
filename,

@@ -50,0 +50,0 @@ mimetype,

@@ -138,5 +138,5 @@ let ssmInstance

.split(`${path}/`)
.join(``) // replace path
.split(`/`)
.join(`_`) // replace remaining slashes with underscores
.join('') // replace path
.split('/')
.join('_') // replace remaining slashes with underscores

@@ -143,0 +143,0 @@ const fullLocalName = prefix ? `${prefix}_${localName}` : localName

@@ -22,6 +22,6 @@ const createError = require('http-errors')

const languageNormalizationMap = {
'pt': 'pt-BR',
pt: 'pt-BR',
'pt-br': 'pt-BR',
'pt_BR': 'pt-BR',
'pt_br': 'pt-BR'
pt_BR: 'pt-BR',
pt_br: 'pt-BR'
}

@@ -28,0 +28,0 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc