Socket
Socket
Sign inDemoInstall

@middy/do-not-wait-for-empty-event-loop

Package Overview
Dependencies
Maintainers
3
Versions
220
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@middy/do-not-wait-for-empty-event-loop - npm Package Compare versions

Comparing version 5.1.0 to 5.2.0

37

index.js
const defaults = {
runOnBefore: true,
runOnAfter: false,
runOnError: false
};
const doNotWaitForEmptyEventLoopMiddleware = (opts = {})=>{
const options = {
...defaults,
...opts
};
const doNotWaitForEmptyEventLoop = async (request)=>{
request.context.callbackWaitsForEmptyEventLoop = false;
};
return {
before: options.runOnBefore ? doNotWaitForEmptyEventLoop : undefined,
after: options.runOnAfter ? doNotWaitForEmptyEventLoop : undefined,
onError: options.runOnError ? doNotWaitForEmptyEventLoop : undefined
};
};
export default doNotWaitForEmptyEventLoopMiddleware;
runOnBefore: true,
runOnAfter: false,
runOnError: false
}
const doNotWaitForEmptyEventLoopMiddleware = (opts = {}) => {
const options = { ...defaults, ...opts }
const doNotWaitForEmptyEventLoop = async (request) => {
request.context.callbackWaitsForEmptyEventLoop = false
}
return {
before: options.runOnBefore ? doNotWaitForEmptyEventLoop : undefined,
after: options.runOnAfter ? doNotWaitForEmptyEventLoop : undefined,
onError: options.runOnError ? doNotWaitForEmptyEventLoop : undefined
}
}
export default doNotWaitForEmptyEventLoopMiddleware
{
"name": "@middy/do-not-wait-for-empty-event-loop",
"version": "5.1.0",
"version": "5.2.0",
"description": "Middleware for the middy framework that allows to easily disable the wait for empty event loop in a Lambda function",

@@ -60,7 +60,7 @@ "type": "module",

},
"gitHead": "bbdaf5843914921804ba085dd58117273febe6b5",
"gitHead": "2d9096a49cd8fb62359517be96d6c93609df41f0",
"devDependencies": {
"@middy/core": "5.1.0",
"@middy/core": "5.2.0",
"@types/aws-lambda": "^8.10.76"
}
}
SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc