express-zod-safe 1.1.0 → 1.1.2

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/dist/index.js +1 -1
  2. package/package.json +9 -9
package/dist/index.js CHANGED
@@ -7,7 +7,7 @@ const types = ['query', 'params', 'body'];
7
7
  * @returns Whether the provided schema is a ZodSchema.
8
8
  */
9
9
  function isZodSchema(schema) {
10
- return schema && schema instanceof zod_1.ZodSchema;
10
+ return schema && typeof schema.safeParse === 'function';
11
11
  }
12
12
  /**
13
13
  * Generates a middleware function for Express.js that validates request params, query, and body.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "express-zod-safe",
3
- "version": "1.1.0",
3
+ "version": "1.1.2",
4
4
  "description": "TypeScript-friendly middleware designed for Express applications, leveraging the robustness of Zod schemas to validate incoming request bodies, parameters, and queries.",
5
5
  "main": "dist/index.js",
6
6
  "repository": {
@@ -22,14 +22,14 @@
22
22
  },
23
23
  "homepage": "https://github.com/AngaBlue/express-zod-safe#readme",
24
24
  "devDependencies": {
25
- "@angablue/eslint-config": "^1.4.4",
26
- "@types/node": "^20.10.7",
27
- "eslint": "^8.56.0",
28
- "express": "^4.18.2",
29
- "prettier": "^3.1.1",
30
- "rimraf": "^5.0.5",
31
- "typescript": "^5.3.3",
32
- "zod": "^3.22.4"
25
+ "@angablue/eslint-config": "^1.4.5",
26
+ "@types/node": "^20.14.6",
27
+ "eslint": "^8.57.0",
28
+ "express": "^4.19.2",
29
+ "prettier": "^3.3.2",
30
+ "rimraf": "^5.0.7",
31
+ "typescript": "^5.4.5",
32
+ "zod": "^3.23.8"
33
33
  },
34
34
  "peerDependencies": {
35
35
  "@types/express": "^4.0.0",