Files
pyrofetes-frontend/node_modules/zod/src/v3/helpers/errorUtil.ts
CHEVALLIER Abel cb235644dc init
2025-11-13 16:23:22 +01:00

9 lines
408 B
TypeScript

export namespace errorUtil {
export type ErrMessage = string | { message?: string | undefined };
export const errToObj = (message?: ErrMessage): { message?: string | undefined } =>
typeof message === "string" ? { message } : message || {};
// biome-ignore lint:
export const toString = (message?: ErrMessage): string | undefined =>
typeof message === "string" ? message : message?.message;
}