(input: unknown)
| 71 | } |
| 72 | |
| 73 | function json(input: unknown) { |
| 74 | if (typeof input === "string") { |
| 75 | try { |
| 76 | const result = JSON.parse(input) |
| 77 | if (result && typeof result === "object") return result |
| 78 | return undefined |
| 79 | } catch { |
| 80 | return undefined |
| 81 | } |
| 82 | } |
| 83 | if (typeof input === "object" && input !== null) { |
| 84 | return input |
| 85 | } |
| 86 | return undefined |
| 87 | } |
| 88 | |
| 89 | export type ParsedStreamError = |
| 90 | | { |
no outgoing calls
no test coverage detected