@middy/do-not-wait-for-empty-event-loop
Advanced tools
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" | ||
} | ||
} |
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
6628
25