Add is.nodeStream() (#34)

This commit is contained in:
Brandon Smith 2017-11-19 15:16:06 -05:00 committed by Sindre Sorhus
parent ae3adc9818
commit a04a04c131
4 changed files with 38 additions and 1 deletions

View file

@ -211,6 +211,16 @@ is.inRange(3, 10);
Returns `true` if `value` is a DOM Element.
##### .nodeStream(value)
Returns `true` if `value` is a Node.js [stream](https://nodejs.org/api/stream.html).
```js
const fs = require('fs');
is.nodeStream(fs.createReadStream('unicorn.png'));
//=> true
```
##### .infinite(value)
Check if `value` is `Infinity` or `-Infinity`.