swc/crates/swc_bundler/tests/.cache/untrusted/fe71b3490cf756880bf07797f6158d917c178ae1.ts
2021-11-09 20:42:49 +09:00

9 lines
341 B
TypeScript

// Loaded from https://raw.githubusercontent.com/colinhacks/zod/654680afc2ede388e71e09104eac5a0088fe3207/deno/lib/helpers/errorUtil.ts
export namespace errorUtil {
export type ErrMessage = string | { message?: string };
export const errToObj = (message?: ErrMessage) =>
typeof message === "string" ? { message } : message || {};
}