(thrown: unknown)
| 1 | export function getErrorMessage(thrown: unknown): string | undefined { |
| 2 | switch (typeof thrown) { |
| 3 | case "object": { |
| 4 | if ( |
| 5 | thrown !== null && |
| 6 | "message" in thrown && |
| 7 | typeof thrown.message === "string" |
| 8 | ) { |
| 9 | return thrown.message; |
| 10 | } |
| 11 | break; |
| 12 | } |
| 13 | case "string": { |
| 14 | return thrown; |
| 15 | } |
| 16 | } |
| 17 | } |
no outgoing calls
no test coverage detected
searching dependent graphs…