Skip to main content
Module

x/zod/helpers/errorUtil.ts

TypeScript-first schema validation with static type inference
Extremely Popular
Go to Latest
File
export namespace errorUtil { export type ErrMessage = string | { message?: string }; export const errToObj = (message?: ErrMessage) => typeof message === "string" ? { message } : message || {}; export const toString = (message?: ErrMessage): string | undefined => typeof message === "string" ? message : message?.message;}