fastsync.js
function makeChainedCallback(i, fns, results, cb) {
        return function(err, result) {
            if (err) {
                return cb(err);
            }
            results[i] = result;
            if (fns[i + 1]) {
                return fns[i + 1](makeChainedCallback(i + 1, fns, results, cb));
            } else {
                return cb(null, results);
            }
        };
    }
function makeChainedCallback(i, fns, results, cb) {
        return function(err, result) {
            if (err) {
                return cb(err);
            }
            results[i] = result;
            if (fns[i + 1]) {
                return fns[i + 1](makeChainedCallback(i + 1, fns, results, cb));
            } else {
                return cb(null, results);
            }
        };
    }
function makeChainedCallback ( i , fns , results , cb ) { return function ( err , result ) { if ( err ) { return cb ( err ) ; } results [ i ] = result ; if ( fns [ i + 1 ] ) { return fns [ i + 1 ] ( makeChainedCallback ( i + 1 , fns , results , cb ) ) ; } else { return cb ( null , results ) ; } } ; }
Create a function that will call the next function in a chain
when finished
Create a function that will call the next function in a chain when finished