@middy/warmup 2.5.2 → 2.5.6

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 +10 -13
  2. package/package.json +3 -3
package/index.js CHANGED
@@ -1,23 +1,20 @@
1
- "use strict";
2
1
 
3
2
  const defaults = {
4
- isWarmingUp: event => (event === null || event === void 0 ? void 0 : event.source) === 'serverless-plugin-warmup'
5
- };
3
+ isWarmingUp: (event) => (event?.source === 'serverless-plugin-warmup')
4
+ }
6
5
 
7
- const warmupMiddleware = opt => {
8
- const options = { ...defaults,
9
- ...opt
10
- };
6
+ const warmupMiddleware = (opt) => {
7
+ const options = { ...defaults, ...opt }
11
8
 
12
- const warmupMiddlewareBefore = request => {
9
+ const warmupMiddlewareBefore = (request) => {
13
10
  if (options.isWarmingUp(request.event)) {
14
- return 'warmup';
11
+ return 'warmup'
15
12
  }
16
- };
13
+ }
17
14
 
18
15
  return {
19
16
  before: warmupMiddlewareBefore
20
- };
21
- };
17
+ }
18
+ }
22
19
 
23
- module.exports = warmupMiddleware;
20
+ module.exports = warmupMiddleware
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@middy/warmup",
3
- "version": "2.5.2",
3
+ "version": "2.5.6",
4
4
  "description": "Warmup (cold start mitigation) middleware for the middy framework",
5
5
  "type": "commonjs",
6
6
  "engines": {
@@ -46,7 +46,7 @@
46
46
  },
47
47
  "homepage": "https://github.com/middyjs/middy#readme",
48
48
  "devDependencies": {
49
- "@middy/core": "^2.5.2"
49
+ "@middy/core": "^2.5.6"
50
50
  },
51
- "gitHead": "a2bb757a7a13638ae64277f8eecfcf11c1af17d4"
51
+ "gitHead": "0c789f55b4adf691f977b0d9904d1a805bb3bb2b"
52
52
  }