(error: unknown)
| 19 | } |
| 20 | |
| 21 | function getErrorCode(error: unknown): string | undefined { |
| 22 | if (!error || typeof error !== "object") { |
| 23 | return undefined; |
| 24 | } |
| 25 | |
| 26 | if ("code" in error && typeof error.code === "string") { |
| 27 | return error.code; |
| 28 | } |
| 29 | |
| 30 | return undefined; |
| 31 | } |
| 32 | |
| 33 | export function isIgnorableStreamError(error: unknown): boolean { |
| 34 | const code = getErrorCode(error); |
no outgoing calls
no test coverage detected