lib/streamify.js
function wrapIteratorCallback(callback, key)
{
  var stream = this;

  return function(error, output)
  {
    // don't repeat yourself
    if (!(key in stream.jobs))
    {
      callback(error, output);
      return;
    }

    // clean up jobs
    delete stream.jobs[key];

    return streamer.call(stream, error, {key: key, value: output}, callback);
  };
}
function wrapIteratorCallback(callback, key)
{
  var stream = this;

  return function(error, output)
  {
    // don't repeat yourself
    if (!(key in stream.jobs))
    {
      callback(error, output);
      return;
    }

    // clean up jobs
    delete stream.jobs[key];

    return streamer.call(stream, error, {key: key, value: output}, callback);
  };
}
function wrapIteratorCallback ( callback , key ) { var stream = this ; return function ( error , output ) { // don't repeat yourself if ( ! ( key in stream . jobs ) ) { callback ( error , output ) ; return ; } // clean up jobs delete stream . jobs [ key ] ; return streamer . call ( stream , error , { key : key , value : output } , callback ) ; } ; }
Wraps provided iterator callback function
makes sure snitch only called once,
but passes secondary calls to the original callback

@this    ReadableAsyncKit#
@param   {function} callback - callback to wrap
@param   {number|string} key - iteration key
@returns {function} wrapped callback
Wraps provided iterator callback function makes sure snitch only called once but passes secondary calls to the original callback