@middy/warmup 6.1.6 → 6.2.1

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 +5 -5
  2. package/index.js +13 -13
  3. package/package.json +65 -68
package/index.d.ts CHANGED
@@ -1,10 +1,10 @@
1
- import middy from '@middy/core'
1
+ import type middy from "@middy/core";
2
2
 
3
3
  interface Options {
4
- isWarmingUp?: (event: any) => boolean
5
- onWarmup?: (event: any) => void
4
+ isWarmingUp?: (event: any) => boolean;
5
+ onWarmup?: (event: any) => undefined;
6
6
  }
7
7
 
8
- declare function warmup (options?: Options): middy.MiddlewareObj
8
+ declare function warmup(options?: Options): middy.MiddlewareObj;
9
9
 
10
- export default warmup
10
+ export default warmup;
package/index.js CHANGED
@@ -1,19 +1,19 @@
1
1
  const defaults = {
2
- isWarmingUp: (event) => event.source === 'serverless-plugin-warmup'
3
- }
2
+ isWarmingUp: (event) => event.source === "serverless-plugin-warmup",
3
+ };
4
4
 
5
5
  const warmupMiddleware = (opt) => {
6
- const options = { ...defaults, ...opt }
6
+ const options = { ...defaults, ...opt };
7
7
 
8
- const warmupMiddlewareBefore = (request) => {
9
- if (options.isWarmingUp(request.event)) {
10
- return 'warmup'
11
- }
12
- }
8
+ const warmupMiddlewareBefore = (request) => {
9
+ if (options.isWarmingUp(request.event)) {
10
+ return "warmup";
11
+ }
12
+ };
13
13
 
14
- return {
15
- before: warmupMiddlewareBefore
16
- }
17
- }
14
+ return {
15
+ before: warmupMiddlewareBefore,
16
+ };
17
+ };
18
18
 
19
- export default warmupMiddleware
19
+ export default warmupMiddleware;
package/package.json CHANGED
@@ -1,70 +1,67 @@
1
1
  {
2
- "name": "@middy/warmup",
3
- "version": "6.1.6",
4
- "description": "Warmup (cold start mitigation) middleware for the middy framework",
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
- "Warmup",
46
- "Heart beat",
47
- "Cold start"
48
- ],
49
- "author": {
50
- "name": "Middy contributors",
51
- "url": "https://github.com/middyjs/middy/graphs/contributors"
52
- },
53
- "repository": {
54
- "type": "git",
55
- "url": "git+https://github.com/middyjs/middy.git",
56
- "directory": "packages/warmup"
57
- },
58
- "bugs": {
59
- "url": "https://github.com/middyjs/middy/issues"
60
- },
61
- "homepage": "https://middy.js.org",
62
- "funding": {
63
- "type": "github",
64
- "url": "https://github.com/sponsors/willfarrell"
65
- },
66
- "devDependencies": {
67
- "@middy/core": "6.1.6"
68
- },
69
- "gitHead": "7a6c0fbb8ab71d6a2171e678697de9f237568431"
2
+ "name": "@middy/warmup",
3
+ "version": "6.2.1",
4
+ "description": "Warmup (cold start mitigation) middleware for the middy framework",
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
+ "Warmup",
43
+ "Heart beat",
44
+ "Cold start"
45
+ ],
46
+ "author": {
47
+ "name": "Middy contributors",
48
+ "url": "https://github.com/middyjs/middy/graphs/contributors"
49
+ },
50
+ "repository": {
51
+ "type": "git",
52
+ "url": "git+https://github.com/middyjs/middy.git",
53
+ "directory": "packages/warmup"
54
+ },
55
+ "bugs": {
56
+ "url": "https://github.com/middyjs/middy/issues"
57
+ },
58
+ "homepage": "https://middy.js.org",
59
+ "funding": {
60
+ "type": "github",
61
+ "url": "https://github.com/sponsors/willfarrell"
62
+ },
63
+ "devDependencies": {
64
+ "@middy/core": "6.2.1"
65
+ },
66
+ "gitHead": "7a6c0fbb8ab71d6a2171e678697de9f237568431"
70
67
  }