lib/schedule.js
function peekNextJob(){
  if(queue.size() <= 0)
    return null;

  let job = null;

  do{
    job = map[queue.peek().id];
    if(!job) queue.pop();
  }while(!job && queue.size() > 0);

  return (!!job)?job:null;
}
function peekNextJob(){
  if(queue.size() <= 0)
    return null;

  let job = null;

  do{
    job = map[queue.peek().id];
    if(!job) queue.pop();
  }while(!job && queue.size() > 0);

  return (!!job)?job:null;
}
function peekNextJob ( ) { if ( queue . size ( ) <= 0 ) return null ; let job = null ; do { job = map [ queue . peek ( ) . id ] ; if ( ! job ) queue . pop ( ) ; } while ( ! job && queue . size ( ) > 0 ) ; return ( ! ! job ) ? job : null ; }
Return, but not remove the next valid job
@return Next valid job
Return but not remove the next valid job