lib/streamify.js
function wrapIterator(iterator)
{
  var stream = this;

  return function(item, key, cb)
  {
    var aborter
      , wrappedCb = async(wrapIteratorCallback.call(stream, cb, key))
      ;

    stream.jobs[key] = wrappedCb;

    // it's either shortcut (item, cb)
    if (iterator.length == 2)
    {
      aborter = iterator(item, wrappedCb);
    }
    // or long format (item, key, cb)
    else
    {
      aborter = iterator(item, key, wrappedCb);
    }

    return aborter;
  };
}
function wrapIterator(iterator)
{
  var stream = this;

  return function(item, key, cb)
  {
    var aborter
      , wrappedCb = async(wrapIteratorCallback.call(stream, cb, key))
      ;

    stream.jobs[key] = wrappedCb;

    // it's either shortcut (item, cb)
    if (iterator.length == 2)
    {
      aborter = iterator(item, wrappedCb);
    }
    // or long format (item, key, cb)
    else
    {
      aborter = iterator(item, key, wrappedCb);
    }

    return aborter;
  };
}
function wrapIterator ( iterator ) { var stream = this ; return function ( item , key , cb ) { var aborter , wrappedCb = async ( wrapIteratorCallback . call ( stream , cb , key ) ) ; stream . jobs [ key ] = wrappedCb ; // it's either shortcut (item, cb) if ( iterator . length == 2 ) { aborter = iterator ( item , wrappedCb ) ; } // or long format (item, key, cb) else { aborter = iterator ( item , key , wrappedCb ) ; } return aborter ; } ; }
Wraps iterators with long signature

@this    ReadableAsyncKit#
@param   {function} iterator - function to wrap
@returns {function} - wrapped function
Wraps iterators with long signature