UNPKG

vite-plugin-react-server

Version:
18 lines (17 loc) 422 B
export function serializeErrorInfo(errorInfo: unknown): null | { componentStack?: string | undefined; digest?: string | undefined; } { if(errorInfo == null || typeof errorInfo !== "object") { return null; } const { componentStack, digest, ...rest } = errorInfo as { componentStack?: string; digest?: string; }; return { componentStack: componentStack, digest: digest, ...rest, }; }