lib/iterate.js
function runJob(iterator, key, item, callback)
{
  var aborter;

  // allow shortcut if iterator expects only two arguments
  if (iterator.length == 2)
  {
    aborter = iterator(item, async(callback));
  }
  // otherwise go with full three arguments
  else
  {
    aborter = iterator(item, key, async(callback));
  }

  return aborter;
}
function runJob(iterator, key, item, callback)
{
  var aborter;

  // allow shortcut if iterator expects only two arguments
  if (iterator.length == 2)
  {
    aborter = iterator(item, async(callback));
  }
  // otherwise go with full three arguments
  else
  {
    aborter = iterator(item, key, async(callback));
  }

  return aborter;
}
function runJob ( iterator , key , item , callback ) { var aborter ; // allow shortcut if iterator expects only two arguments if ( iterator . length == 2 ) { aborter = iterator ( item , async ( callback ) ) ; } // otherwise go with full three arguments else { aborter = iterator ( item , key , async ( callback ) ) ; } return aborter ; }
Runs iterator over provided job element

@param   {function} iterator - iterator to invoke
@param   {string|number} key - key/index of the element in the list of jobs
@param   {mixed} item - job description
@param   {function} callback - invoked after iterator is done with the job
@returns {function|mixed} - job abort function or something else
Runs iterator over provided job element