@middy/do-not-wait-for-empty-event-loop
Advanced tools
Comparing version 5.0.0-alpha.0 to 5.0.0-alpha.1
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.0.0-alpha.0", | ||
"version": "5.0.0-alpha.1", | ||
"description": "Middleware for the middy framework that allows to easily disable the wait for empty event loop in a Lambda function", | ||
@@ -13,3 +13,2 @@ "type": "module", | ||
}, | ||
"main": "./index.cjs", | ||
"module": "./index.js", | ||
@@ -21,6 +20,2 @@ "exports": { | ||
"default": "./index.js" | ||
}, | ||
"require": { | ||
"types": "./index.d.ts", | ||
"default": "./index.cjs" | ||
} | ||
@@ -32,3 +27,2 @@ } | ||
"index.js", | ||
"index.cjs", | ||
"index.d.ts" | ||
@@ -69,7 +63,7 @@ ], | ||
}, | ||
"gitHead": "08c35e3dba9efdad0b86666ce206ce302cc65d07", | ||
"gitHead": "ebce8d5df8783077fa49ba62ee9be20e8486a7f1", | ||
"devDependencies": { | ||
"@middy/core": "5.0.0-alpha.0", | ||
"@middy/core": "5.0.0-alpha.1", | ||
"@types/aws-lambda": "^8.10.76" | ||
} | ||
} |
@@ -22,4 +22,5 @@ <div align="center"> | ||
</a> | ||
<a href="https://lgtm.com/projects/g/middyjs/middy/context:javascript"> | ||
<img src="https://img.shields.io/lgtm/grade/javascript/g/middyjs/middy.svg?logo=lgtm&logoWidth=18" alt="Language grade: JavaScript" style="max-width:100%;"> | ||
<a href="https://github.com/middyjs/middy/actions/workflows/sast.yml"> | ||
<img src="https://github.com/middyjs/middy/actions/workflows/sast.yml/badge.svg | ||
?branch=main&event=push" alt="CodeQL" style="max-width:100%;"> | ||
</a> | ||
@@ -26,0 +27,0 @@ <a href="https://bestpractices.coreinfrastructure.org/projects/5280"> |
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
47
6644
5
25