@middy/warmup 3.0.0-alpha.2 → 3.0.0-alpha.3

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 (2) hide show
  1. package/index.js +11 -12
  2. package/package.json +5 -4
package/index.js CHANGED
@@ -1,21 +1,20 @@
1
+
1
2
  const defaults = {
2
- isWarmingUp: event => event.source === 'serverless-plugin-warmup'
3
- };
3
+ isWarmingUp: (event) => (event.source === 'serverless-plugin-warmup')
4
+ }
4
5
 
5
- const warmupMiddleware = opt => {
6
- const options = { ...defaults,
7
- ...opt
8
- };
6
+ const warmupMiddleware = (opt) => {
7
+ const options = { ...defaults, ...opt }
9
8
 
10
- const warmupMiddlewareBefore = request => {
9
+ const warmupMiddlewareBefore = (request) => {
11
10
  if (options.isWarmingUp(request.event)) {
12
- return 'warmup';
11
+ return 'warmup'
13
12
  }
14
- };
13
+ }
15
14
 
16
15
  return {
17
16
  before: warmupMiddlewareBefore
18
- };
19
- };
17
+ }
18
+ }
20
19
 
21
- export default warmupMiddleware;
20
+ export default warmupMiddleware
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@middy/warmup",
3
- "version": "3.0.0-alpha.2",
3
+ "version": "3.0.0-alpha.3",
4
4
  "description": "Warmup (cold start mitigation) middleware for the middy framework",
5
5
  "type": "module",
6
6
  "engines": {
@@ -18,7 +18,8 @@
18
18
  ],
19
19
  "scripts": {
20
20
  "test": "npm run test:unit",
21
- "test:unit": "ava"
21
+ "test:unit": "ava",
22
+ "test:benchmark": "node __benchmarks__/index.js"
22
23
  },
23
24
  "license": "MIT",
24
25
  "keywords": [
@@ -47,7 +48,7 @@
47
48
  },
48
49
  "homepage": "https://github.com/middyjs/middy#readme",
49
50
  "devDependencies": {
50
- "@middy/core": "^3.0.0-alpha.2"
51
+ "@middy/core": "^3.0.0-alpha.3"
51
52
  },
52
- "gitHead": "de30419273ecbff08f367f47c7e320ec981cf145"
53
+ "gitHead": "1441158711580313765e6d156046ef0fade0d156"
53
54
  }