lib/utility.js
function createEventEmitterCallback(event, emitter) {
    return function (ex) {
        if (ex) {
            emitter.emit('error', ex);
        } else {
            var args = Array.prototype.slice.call(arguments);
            args[0] = event;
            emitter.emit.apply(emitter, args);
            if (event == 'end') {
                emitter.removeAllListeners();
            }
        }
    };
}
function createEventEmitterCallback(event, emitter) {
    return function (ex) {
        if (ex) {
            emitter.emit('error', ex);
        } else {
            var args = Array.prototype.slice.call(arguments);
            args[0] = event;
            emitter.emit.apply(emitter, args);
            if (event == 'end') {
                emitter.removeAllListeners();
            }
        }
    };
}
function createEventEmitterCallback ( event , emitter ) { return function ( ex ) { if ( ex ) { emitter . emit ( 'error' , ex ) ; } else { var args = Array . prototype . slice . call ( arguments ) ; args [ 0 ] = event ; emitter . emit . apply ( emitter , args ) ; if ( event == 'end' ) { emitter . removeAllListeners ( ) ; } } } ; }
Provides a callback function that emits the supplied event type or an error event.
Provides a callback function that emits the supplied event type or an error event .