@middy/do-not-wait-for-empty-event-loop 6.1.5 → 6.2.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.
Files changed (3) hide show
  1. package/index.d.ts +8 -6
  2. package/index.js +15 -15
  3. package/package.json +64 -67
package/index.d.ts CHANGED
@@ -1,11 +1,13 @@
1
- import middy from '@middy/core'
1
+ import type middy from "@middy/core";
2
2
 
3
3
  interface Options {
4
- runOnBefore?: boolean
5
- runOnAfter?: boolean
6
- runOnError?: boolean
4
+ runOnBefore?: boolean;
5
+ runOnAfter?: boolean;
6
+ runOnError?: boolean;
7
7
  }
8
8
 
9
- declare function doNotWaitForEmptyEventLoop (options?: Options): middy.MiddlewareObj
9
+ declare function doNotWaitForEmptyEventLoop(
10
+ options?: Options,
11
+ ): middy.MiddlewareObj;
10
12
 
11
- export default doNotWaitForEmptyEventLoop
13
+ export default doNotWaitForEmptyEventLoop;
package/index.js CHANGED
@@ -1,20 +1,20 @@
1
1
  const defaults = {
2
- runOnBefore: true,
3
- runOnAfter: false,
4
- runOnError: false
5
- }
2
+ runOnBefore: true,
3
+ runOnAfter: false,
4
+ runOnError: false,
5
+ };
6
6
 
7
7
  const doNotWaitForEmptyEventLoopMiddleware = (opts = {}) => {
8
- const options = { ...defaults, ...opts }
8
+ const options = { ...defaults, ...opts };
9
9
 
10
- const doNotWaitForEmptyEventLoop = async (request) => {
11
- request.context.callbackWaitsForEmptyEventLoop = false
12
- }
10
+ const doNotWaitForEmptyEventLoop = async (request) => {
11
+ request.context.callbackWaitsForEmptyEventLoop = false;
12
+ };
13
13
 
14
- return {
15
- before: options.runOnBefore ? doNotWaitForEmptyEventLoop : undefined,
16
- after: options.runOnAfter ? doNotWaitForEmptyEventLoop : undefined,
17
- onError: options.runOnError ? doNotWaitForEmptyEventLoop : undefined
18
- }
19
- }
20
- export default doNotWaitForEmptyEventLoopMiddleware
14
+ return {
15
+ before: options.runOnBefore ? doNotWaitForEmptyEventLoop : undefined,
16
+ after: options.runOnAfter ? doNotWaitForEmptyEventLoop : undefined,
17
+ onError: options.runOnError ? doNotWaitForEmptyEventLoop : undefined,
18
+ };
19
+ };
20
+ export default doNotWaitForEmptyEventLoopMiddleware;
package/package.json CHANGED
@@ -1,69 +1,66 @@
1
1
  {
2
- "name": "@middy/do-not-wait-for-empty-event-loop",
3
- "version": "6.1.5",
4
- "description": "Middleware for the middy framework that allows to easily disable the wait for empty event loop in a Lambda function",
5
- "type": "module",
6
- "engines": {
7
- "node": ">=20"
8
- },
9
- "engineStrict": true,
10
- "publishConfig": {
11
- "access": "public"
12
- },
13
- "module": "./index.js",
14
- "exports": {
15
- ".": {
16
- "import": {
17
- "types": "./index.d.ts",
18
- "default": "./index.js"
19
- },
20
- "require": {
21
- "default": "./index.js"
22
- }
23
- }
24
- },
25
- "types": "index.d.ts",
26
- "files": [
27
- "index.js",
28
- "index.d.ts"
29
- ],
30
- "scripts": {
31
- "test": "npm run test:unit && npm run test:fuzz",
32
- "test:unit": "node --test __tests__/index.js",
33
- "test:fuzz": "node --test __tests__/fuzz.js",
34
- "test:benchmark": "node __benchmarks__/index.js"
35
- },
36
- "license": "MIT",
37
- "keywords": [
38
- "Lambda",
39
- "Middleware",
40
- "Serverless",
41
- "Framework",
42
- "AWS",
43
- "AWS Lambda",
44
- "Middy",
45
- "Event loop"
46
- ],
47
- "author": {
48
- "name": "Middy contributors",
49
- "url": "https://github.com/middyjs/middy/graphs/contributors"
50
- },
51
- "repository": {
52
- "type": "git",
53
- "url": "git+https://github.com/middyjs/middy.git",
54
- "directory": "packages/do-not-wait-for-empty-event-loop"
55
- },
56
- "bugs": {
57
- "url": "https://github.com/middyjs/middy/issues"
58
- },
59
- "homepage": "https://middy.js.org",
60
- "funding": {
61
- "type": "github",
62
- "url": "https://github.com/sponsors/willfarrell"
63
- },
64
- "gitHead": "7a6c0fbb8ab71d6a2171e678697de9f237568431",
65
- "devDependencies": {
66
- "@middy/core": "6.1.5",
67
- "@types/aws-lambda": "^8.10.76"
68
- }
2
+ "name": "@middy/do-not-wait-for-empty-event-loop",
3
+ "version": "6.2.0",
4
+ "description": "Middleware for the middy framework that allows to easily disable the wait for empty event loop in a Lambda function",
5
+ "type": "module",
6
+ "engines": {
7
+ "node": ">=20"
8
+ },
9
+ "engineStrict": true,
10
+ "publishConfig": {
11
+ "access": "public"
12
+ },
13
+ "module": "./index.js",
14
+ "exports": {
15
+ ".": {
16
+ "import": {
17
+ "types": "./index.d.ts",
18
+ "default": "./index.js"
19
+ },
20
+ "require": {
21
+ "default": "./index.js"
22
+ }
23
+ }
24
+ },
25
+ "types": "index.d.ts",
26
+ "files": ["index.js", "index.d.ts"],
27
+ "scripts": {
28
+ "test": "npm run test:unit && npm run test:fuzz",
29
+ "test:unit": "node --test",
30
+ "test:fuzz": "node --test index.fuzz.js",
31
+ "test:perf": "node --test index.perf.js"
32
+ },
33
+ "license": "MIT",
34
+ "keywords": [
35
+ "Lambda",
36
+ "Middleware",
37
+ "Serverless",
38
+ "Framework",
39
+ "AWS",
40
+ "AWS Lambda",
41
+ "Middy",
42
+ "Event loop"
43
+ ],
44
+ "author": {
45
+ "name": "Middy contributors",
46
+ "url": "https://github.com/middyjs/middy/graphs/contributors"
47
+ },
48
+ "repository": {
49
+ "type": "git",
50
+ "url": "git+https://github.com/middyjs/middy.git",
51
+ "directory": "packages/do-not-wait-for-empty-event-loop"
52
+ },
53
+ "bugs": {
54
+ "url": "https://github.com/middyjs/middy/issues"
55
+ },
56
+ "homepage": "https://middy.js.org",
57
+ "funding": {
58
+ "type": "github",
59
+ "url": "https://github.com/sponsors/willfarrell"
60
+ },
61
+ "gitHead": "7a6c0fbb8ab71d6a2171e678697de9f237568431",
62
+ "devDependencies": {
63
+ "@middy/core": "6.2.0",
64
+ "@types/aws-lambda": "^8.10.76"
65
+ }
69
66
  }