@middy/warmup 7.2.3 → 7.3.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 +4 -0
  2. package/index.js +9 -0
  3. package/package.json +2 -5
package/index.d.ts CHANGED
@@ -10,4 +10,8 @@ declare function warmup(
10
10
  options?: Options,
11
11
  ): middy.MiddlewareObj<unknown, unknown, Error>;
12
12
 
13
+ export declare function warmupValidateOptions(
14
+ options?: Record<string, unknown>,
15
+ ): void;
16
+
13
17
  export default warmup;
package/index.js CHANGED
@@ -1,9 +1,18 @@
1
1
  // Copyright 2017 - 2026 will Farrell, Luciano Mammino, and Middy contributors.
2
2
  // SPDX-License-Identifier: MIT
3
+ import { validateOptions } from "@middy/util";
4
+
3
5
  const defaults = {
4
6
  isWarmingUp: (event) => event.source === "serverless-plugin-warmup",
5
7
  };
6
8
 
9
+ const optionSchema = {
10
+ isWarmingUp: "function?",
11
+ };
12
+
13
+ export const warmupValidateOptions = (options) =>
14
+ validateOptions("@middy/warmup", optionSchema, options);
15
+
7
16
  const warmupMiddleware = (opts = {}) => {
8
17
  const options = { ...defaults, ...opts };
9
18
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@middy/warmup",
3
- "version": "7.2.3",
3
+ "version": "7.3.0",
4
4
  "description": "Warmup (cold start mitigation) middleware for the middy framework",
5
5
  "type": "module",
6
6
  "engines": {
@@ -17,9 +17,6 @@
17
17
  "import": {
18
18
  "types": "./index.d.ts",
19
19
  "default": "./index.js"
20
- },
21
- "require": {
22
- "default": "./index.js"
23
20
  }
24
21
  }
25
22
  },
@@ -65,7 +62,7 @@
65
62
  "url": "https://github.com/sponsors/willfarrell"
66
63
  },
67
64
  "devDependencies": {
68
- "@middy/core": "7.2.3",
65
+ "@middy/core": "7.3.0",
69
66
  "@types/aws-lambda": "^8.0.0",
70
67
  "@types/node": "^22.0.0"
71
68
  }