mirror of
https://github.com/formbricks/formbricks.git
synced 2026-01-08 16:21:09 -06:00
10 lines
290 B
TypeScript
10 lines
290 B
TypeScript
import { ZodError } from "zod";
|
|
|
|
export const transformErrorToDetails = (error: ZodError<any>): { [key: string]: string } => {
|
|
const details: { [key: string]: string } = {};
|
|
for (const issue of error.issues) {
|
|
details[issue.path.join(".")] = issue.message;
|
|
}
|
|
return details;
|
|
};
|