@modern-js/bff-core 2.60.3 → 2.60.4

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.
@@ -1,9 +1,7 @@
1
1
  "use strict";
2
- var __create = Object.create;
3
2
  var __defProp = Object.defineProperty;
4
3
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
4
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
5
  var __hasOwnProp = Object.prototype.hasOwnProperty;
8
6
  var __export = (target, all) => {
9
7
  for (var name in all)
@@ -17,14 +15,6 @@ var __copyProps = (to, from, except, desc) => {
17
15
  }
18
16
  return to;
19
17
  };
20
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
- // If the importer is in node compatibility mode or this is not an ESM
22
- // file that has been converted to a CommonJS file using a Babel-
23
- // compatible transform (i.e. "__esModule" has not been set), then set
24
- // "default" to the CommonJS "module.exports" for node compatibility.
25
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
- mod
27
- ));
28
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
19
  var http_exports = {};
30
20
  __export(http_exports, {
@@ -53,8 +43,7 @@ const validateInput = async (schema, input) => {
53
43
  try {
54
44
  return await schema.parseAsync(input);
55
45
  } catch (error) {
56
- const { z: zod } = await import("zod");
57
- if (error instanceof zod.ZodError) {
46
+ if ("name" in error && error.name === "ZodError") {
58
47
  throw new import_http.ValidationError(400, error.message);
59
48
  }
60
49
  throw error;
@@ -4,8 +4,7 @@ const validateInput = async (schema, input) => {
4
4
  try {
5
5
  return await schema.parseAsync(input);
6
6
  } catch (error) {
7
- const { z: zod } = await import("zod");
8
- if (error instanceof zod.ZodError) {
7
+ if ("name" in error && error.name === "ZodError") {
9
8
  throw new ValidationError(400, error.message);
10
9
  }
11
10
  throw error;
package/package.json CHANGED
@@ -15,7 +15,7 @@
15
15
  "modern",
16
16
  "modern.js"
17
17
  ],
18
- "version": "2.60.3",
18
+ "version": "2.60.4",
19
19
  "jsnext:source": "./src/index.ts",
20
20
  "types": "./dist/types/index.d.ts",
21
21
  "main": "./dist/cjs/index.js",
@@ -32,7 +32,7 @@
32
32
  "koa-compose": "^4.1.0",
33
33
  "reflect-metadata": "^0.1.13",
34
34
  "type-fest": "2.15.0",
35
- "@modern-js/utils": "2.60.3"
35
+ "@modern-js/utils": "2.60.4"
36
36
  },
37
37
  "devDependencies": {
38
38
  "@types/jest": "^29",
@@ -43,9 +43,9 @@
43
43
  "tsconfig-paths": "^4.1.2",
44
44
  "typescript": "^5",
45
45
  "zod": "^3.22.3",
46
- "@scripts/jest-config": "2.60.3",
47
- "@scripts/build": "2.60.3",
48
- "@modern-js/types": "2.60.3"
46
+ "@modern-js/types": "2.60.4",
47
+ "@scripts/build": "2.60.4",
48
+ "@scripts/jest-config": "2.60.4"
49
49
  },
50
50
  "peerDependencies": {
51
51
  "ts-node": "^10.9.1",