Skip to content

Commit

Permalink
Merge pull request #343 from Whoaa512/is-stream-return-bool
Browse files Browse the repository at this point in the history
Cast the return value of isStream and friends to a boolean.
  • Loading branch information
vqvu committed Jul 17, 2015
2 parents 6a60491 + d285ddd commit b3cff35
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -644,22 +644,23 @@ function StreamRedirect(to) {
* @section Utils
* @name _.isStream(x)
* @param x - the object to test
* @returns {Boolean}
* @api public
*
* _.isStream('foo') // => false
* _.isStream(_([1,2,3])) // => true
*/

_.isStream = function (x) {
return _.isObject(x) && x.__HighlandStream__;
return _.isObject(x) && !!x.__HighlandStream__;
};

_._isStreamError = function (x) {
return _.isObject(x) && x.__HighlandStreamError__;
return _.isObject(x) && !!x.__HighlandStreamError__;
};

_._isStreamRedirect = function (x) {
return _.isObject(x) && x.__HighlandStreamRedirect__;
return _.isObject(x) && !!x.__HighlandStreamRedirect__;
};

/**
Expand Down

0 comments on commit b3cff35

Please sign in to comment.