@schema-hub/zod-error-formatter
Version:
Simple and easy-to-understand zod error messages
13 lines • 551 B
JavaScript
import { util } from 'zod/v4/core';
import { formatList } from '../list.js';
import { findValueByPath } from '../path.js';
export function formatInvalidValueIssueMessage(issue, input) {
const result = findValueByPath(input, issue.path);
if (result.found) {
const received = util.getParsedType(result.value);
const expected = formatList(issue.values, ',');
return `invalid literal: expected ${expected}, but got ${received}`;
}
return `missing ${result.pathItemKind}`;
}
//# sourceMappingURL=invalid-value.js.map