@efebia/fastify-zod-reply 1.0.5 → 1.0.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.
@@ -2,7 +2,12 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.routeV4 = void 0;
4
4
  const v4_1 = require("zod/v4");
5
- const mapZodError = (zodError, prefix) => zodError.issues.map(issue => `Error at ${prefix}->${issue.path.join('->')}`).join(';\n');
5
+ const mapZodError = (zodError, prefix) => {
6
+ return zodError.issues.map(issue => {
7
+ const pathStr = `Error at ${prefix}->${issue.path.join('->')}`;
8
+ return issue.message ? `${pathStr}->${issue.message}` : pathStr;
9
+ }).join('\n');
10
+ };
6
11
  const parse = async (schema, payload, tag) => {
7
12
  const result = await schema.safeParseAsync(payload);
8
13
  return Object.assign(Object.assign({}, result), { tag });
@@ -1,5 +1,10 @@
1
1
  import { z } from 'zod/v4';
2
- const mapZodError = (zodError, prefix) => zodError.issues.map(issue => `Error at ${prefix}->${issue.path.join('->')}`).join(';\n');
2
+ const mapZodError = (zodError, prefix) => {
3
+ return zodError.issues.map(issue => {
4
+ const pathStr = `Error at ${prefix}->${issue.path.join('->')}`;
5
+ return issue.message ? `${pathStr}->${issue.message}` : pathStr;
6
+ }).join('\n');
7
+ };
3
8
  const parse = async (schema, payload, tag) => {
4
9
  const result = await schema.safeParseAsync(payload);
5
10
  return Object.assign(Object.assign({}, result), { tag });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@efebia/fastify-zod-reply",
3
- "version": "1.0.5",
3
+ "version": "1.0.6",
4
4
  "license": "MIT",
5
5
  "dependencies": {
6
6
  "fastify": "^5.3.0",