Type guard for plain error objects with numeric status codes.
(value: unknown)
| 29 | |
| 30 | /** Type guard for plain error objects with numeric status codes. */ |
| 31 | function isPlainErrorObject(value: unknown): value is PlainErrorObject { |
| 32 | return ( |
| 33 | typeof value === 'object' && |
| 34 | value !== null && |
| 35 | !Array.isArray(value) && |
| 36 | !(value instanceof Error) && |
| 37 | 'status' in value && |
| 38 | typeof (value as PlainErrorObject).status === 'number' |
| 39 | ); |
| 40 | } |
| 41 | |
| 42 | /** |
| 43 | * An Error subclass with optional HTTP metadata attached by third-party SDKs. |
no outgoing calls
no test coverage detected