mirror of
https://github.com/luxfi/explore.git
synced 2026-09-24 00:28:18 +00:00
16 lines
212 B
TypeScript
16 lines
212 B
TypeScript
export default function getErrorObj(error: unknown) {
|
|
if (typeof error !== 'object') {
|
|
return;
|
|
}
|
|
|
|
if (Array.isArray(error)) {
|
|
return;
|
|
}
|
|
|
|
if (error === null) {
|
|
return;
|
|
}
|
|
|
|
return error;
|
|
}
|