* Get the type string for an unknown value (for error messages)
(value: unknown)
| 83 | * Get the type string for an unknown value (for error messages) |
| 84 | */ |
| 85 | function getReceivedType(value: unknown): string { |
| 86 | if (value === null) return 'null' |
| 87 | if (value === undefined) return 'undefined' |
| 88 | if (Array.isArray(value)) return 'array' |
| 89 | return typeof value |
| 90 | } |
| 91 | |
| 92 | function extractReceivedFromMessage(msg: string): string | undefined { |
| 93 | const match = msg.match(/received (\w+)/) |