mirror of
https://github.com/luxfi/explore.git
synced 2026-09-24 00:28:18 +00:00
9 lines
277 B
TypeScript
9 lines
277 B
TypeScript
export default function getErrorCause(error: Error | undefined): Record<string, unknown> | undefined {
|
|
return (
|
|
error && 'cause' in error &&
|
|
typeof error.cause === 'object' && error.cause !== null &&
|
|
error.cause as Record<string, unknown>
|
|
) ||
|
|
undefined;
|
|
}
|