@middy/do-not-wait-for-empty-event-loop 2.5.1 → 3.0.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +1 -1
- package/README.md +1 -1
- package/package.json +6 -6
- package/index.js +0 -24
package/LICENSE
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
MIT License
|
|
2
2
|
|
|
3
|
-
Copyright (c) 2017-
|
|
3
|
+
Copyright (c) 2017-2022 Luciano Mammino, will Farrell and the [Middy team](https://github.com/middyjs/middy/graphs/contributors)
|
|
4
4
|
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
package/README.md
CHANGED
|
@@ -80,7 +80,7 @@ Everyone is very welcome to contribute to this repository. Feel free to [raise i
|
|
|
80
80
|
|
|
81
81
|
## License
|
|
82
82
|
|
|
83
|
-
Licensed under [MIT License](LICENSE). Copyright (c) 2017-
|
|
83
|
+
Licensed under [MIT License](LICENSE). Copyright (c) 2017-2022 Luciano Mammino, will Farrell, and the [Middy team](https://github.com/middyjs/middy/graphs/contributors).
|
|
84
84
|
|
|
85
85
|
<a href="https://app.fossa.io/projects/git%2Bgithub.com%2Fmiddyjs%2Fmiddy?ref=badge_large">
|
|
86
86
|
<img src="https://app.fossa.io/api/projects/git%2Bgithub.com%2Fmiddyjs%2Fmiddy.svg?type=large" alt="FOSSA Status" style="max-width:100%;">
|
package/package.json
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@middy/do-not-wait-for-empty-event-loop",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0-alpha.0",
|
|
4
4
|
"description": "Middleware for the middy framework that allows to easily disable the wait for empty event loop in a Lambda function",
|
|
5
|
-
"type": "
|
|
5
|
+
"type": "module",
|
|
6
6
|
"engines": {
|
|
7
|
-
"node": ">=
|
|
7
|
+
"node": ">=14"
|
|
8
8
|
},
|
|
9
9
|
"engineStrict": true,
|
|
10
10
|
"publishConfig": {
|
|
11
11
|
"access": "public"
|
|
12
12
|
},
|
|
13
|
-
"
|
|
13
|
+
"exports": "./index.js",
|
|
14
14
|
"types": "index.d.ts",
|
|
15
15
|
"files": [
|
|
16
16
|
"index.d.ts"
|
|
@@ -43,9 +43,9 @@
|
|
|
43
43
|
"url": "https://github.com/middyjs/middy/issues"
|
|
44
44
|
},
|
|
45
45
|
"homepage": "https://github.com/middyjs/middy#readme",
|
|
46
|
-
"gitHead": "
|
|
46
|
+
"gitHead": "c533f62841c8a39d061d7b94f30ba178f002c8db",
|
|
47
47
|
"devDependencies": {
|
|
48
|
-
"@middy/core": "^
|
|
48
|
+
"@middy/core": "^3.0.0-alpha.0",
|
|
49
49
|
"@types/aws-lambda": "^8.10.76"
|
|
50
50
|
}
|
|
51
51
|
}
|
package/index.js
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
const doNotWaitForEmptyEventLoopMiddleware = (opts = {}) => {
|
|
4
|
-
const defaults = {
|
|
5
|
-
runOnBefore: true,
|
|
6
|
-
runOnAfter: false,
|
|
7
|
-
runOnError: false
|
|
8
|
-
};
|
|
9
|
-
const options = { ...defaults,
|
|
10
|
-
...opts
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
const doNotWaitForEmptyEventLoop = async request => {
|
|
14
|
-
request.context.callbackWaitsForEmptyEventLoop = false;
|
|
15
|
-
};
|
|
16
|
-
|
|
17
|
-
return {
|
|
18
|
-
before: options.runOnBefore ? doNotWaitForEmptyEventLoop : undefined,
|
|
19
|
-
after: options.runOnAfter ? doNotWaitForEmptyEventLoop : undefined,
|
|
20
|
-
onError: options.runOnError ? doNotWaitForEmptyEventLoop : undefined
|
|
21
|
-
};
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
module.exports = doNotWaitForEmptyEventLoopMiddleware;
|