async-lite.js
function(tasks, callback) {

      var keys; var length; var i; var results; var kind;
      var updated_tasks = [];
      var is_object;
      var counter = 0;

      if (isArray(tasks)) {

        length = tasks.length;
        results = [];

      } else if (isObject(tasks)) {

        is_object = true;
        keys = ObjectKeys(tasks);
        length = keys.length;
        results = {};

      } else {
        return callback();
      }

      for (i=0; i<length; i++) {

        if (is_object) {
          updated_tasks.push({ k: keys[i], t: tasks[keys[i]] });
        } else {
          updated_tasks.push({ k: i, t: tasks[i] });
        }

      }

      updated_tasks.forEach(function(task_object) {

        task_object.t(function(err, result) {
          if (err) return callback(err);

          results[task_object.k] = result;

          counter++;
          if (counter == length) callback(null, results);
        });

      });

    }
function(tasks, callback) {

      var keys; var length; var i; var results; var kind;
      var updated_tasks = [];
      var is_object;
      var counter = 0;

      if (isArray(tasks)) {

        length = tasks.length;
        results = [];

      } else if (isObject(tasks)) {

        is_object = true;
        keys = ObjectKeys(tasks);
        length = keys.length;
        results = {};

      } else {
        return callback();
      }

      for (i=0; i<length; i++) {

        if (is_object) {
          updated_tasks.push({ k: keys[i], t: tasks[keys[i]] });
        } else {
          updated_tasks.push({ k: i, t: tasks[i] });
        }

      }

      updated_tasks.forEach(function(task_object) {

        task_object.t(function(err, result) {
          if (err) return callback(err);

          results[task_object.k] = result;

          counter++;
          if (counter == length) callback(null, results);
        });

      });

    }
function ( tasks , callback ) { var keys ; var length ; var i ; var results ; var kind ; var updated_tasks = [ ] ; var is_object ; var counter = 0 ; if ( isArray ( tasks ) ) { length = tasks . length ; results = [ ] ; } else if ( isObject ( tasks ) ) { is_object = true ; keys = ObjectKeys ( tasks ) ; length = keys . length ; results = { } ; } else { return callback ( ) ; } for ( i = 0 ; i < length ; i ++ ) { if ( is_object ) { updated_tasks . push ( { k : keys [ i ] , t : tasks [ keys [ i ] ] } ) ; } else { updated_tasks . push ( { k : i , t : tasks [ i ] } ) ; } } updated_tasks . forEach ( function ( task_object ) { task_object . t ( function ( err , result ) { if ( err ) return callback ( err ) ; results [ task_object . k ] = result ; counter ++ ; if ( counter == length ) callback ( null , results ) ; } ) ; } ) ; }
can accept an object or array will return an object or array of results in the correct order
can accept an object or array will return an object or array of results in the correct order