(x: unknown)
| 251 | } |
| 252 | |
| 253 | function asNumber(x: unknown): number { |
| 254 | if (typeof x === 'number') { |
| 255 | return x; |
| 256 | } |
| 257 | throw new Error('Number expected, but got ' + typeof x); |
| 258 | } |
| 259 | |
| 260 | function asString(x: unknown): string { |
| 261 | if (typeof x === 'string') { |