Skip to content

Commit fa17897

Browse files
committed
index.js :: add jsdoc comments to make Inch CI happy
1 parent 044f27c commit fa17897

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

index.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
var Readable = require('readable-stream').Readable
22
;
33

4+
/**
5+
* Create a new instance of StreamArray
6+
*
7+
* @access private
8+
* @param {Array} list
9+
*/
410
function StreamArray(list) {
511
if (!Array.isArray(list))
612
throw new TypeError('First argument must be an Array');
@@ -14,10 +20,25 @@ function StreamArray(list) {
1420

1521
StreamArray.prototype = Object.create(Readable.prototype, {constructor: {value: StreamArray}});
1622

23+
/**
24+
* Read the next item from the source Array and push into NodeJS stream
25+
26+
* @access protected
27+
* @desc Read the next item from the source Array and push into NodeJS stream
28+
* @param {number} size The amount of data to read (ignored)
29+
*/
1730
StreamArray.prototype._read = function(size) {
1831
this.push(this._i < this._l ? this._list[this._i++] : null);
1932
};
2033

34+
/**
35+
* Create a new instance of StreamArray
36+
*
37+
* @module stream-array
38+
* @desc Push Array elements through a NodeJS stream
39+
* @type {function}
40+
* @param {Array} list An Array of objects, strings, numbers, etc
41+
*/
2142
module.exports = function(list) {
2243
return new StreamArray(list);
2344
};

0 commit comments

Comments
 (0)