mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
I'm converting a node program I originally wrote in JS to TS, and
without this, the following pattern causes tsc to error out (tested
under 1.6):
```
let buf = current.read(); // current is a ReadableStream
if (buf !== null)
output.write(buf);
```
With:
```
src/bin/cat.ts(28,17): error TS2345: Argument of type 'string | Buffer' is not assignable to parameter of type 'string'.
```
|
||
|---|---|---|
| .. | ||
| node-0.8.8.d.ts | ||
| node-0.8.8.d.ts.tscparams | ||
| node-0.10.d.ts | ||
| node-0.11-tests.ts | ||
| node-0.11.d.ts | ||
| node-tests.ts | ||
| node.d.ts | ||