(x: any)
| 142 | } |
| 143 | |
| 144 | function serialize(x: any): string { |
| 145 | if (Array.isArray(x)) { |
| 146 | return `[${x.map((y) => recursiveSerialize(y)).join(', ')}]`; |
| 147 | } |
| 148 | if (x === null) return 'null'; |
| 149 | if (x === undefined) return 'undefined'; |
| 150 | if (typeof x === 'object') { |
| 151 | return `[${Object.entries(x) |
| 152 | .map(([key, value]) => '"' + key + '": ' + recursiveSerialize(value)) |
| 153 | .join(', ')}]`; |
| 154 | } |
| 155 | if (typeof x === 'string') { |
| 156 | return `"${x}"`; |
| 157 | } |
| 158 | return x.toString(); |
| 159 | } |
| 160 | |
| 161 | global.console = new EpsilConsole( |
| 162 | process.stdout, |
no test coverage detected