@danielhritcu/zenstack-orm 3.5.10 → 3.5.11
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.
- package/dist/index.cjs +9 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +9 -2
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.cjs
CHANGED
|
@@ -73,9 +73,16 @@ var import_kysely12 = require("kysely");
|
|
|
73
73
|
var import_zod3 = __toESM(require("zod"), 1);
|
|
74
74
|
|
|
75
75
|
// src/utils/zod-utils.ts
|
|
76
|
-
var import_v3 = require("zod-validation-error/v3");
|
|
77
76
|
function formatError(error) {
|
|
78
|
-
|
|
77
|
+
const err = error;
|
|
78
|
+
if (err?.issues && Array.isArray(err.issues)) {
|
|
79
|
+
return err.issues.map((i) => {
|
|
80
|
+
const path = i.path?.length ? i.path.join(".") + ": " : "";
|
|
81
|
+
return path + (i.message ?? "invalid");
|
|
82
|
+
}).join("; ");
|
|
83
|
+
}
|
|
84
|
+
if (err?.message) return String(err.message);
|
|
85
|
+
return String(error);
|
|
79
86
|
}
|
|
80
87
|
__name(formatError, "formatError");
|
|
81
88
|
|