lib/service.js
function parseArguments(options, callback) {
    if (_.isUndefined(options) && _.isUndefined(callback)) { // No params
        return [{}, undefined];
    }
    if (!_.isUndefined(options) && _.isFunction(options)) { // Only callback param
        callback = options;
        options = {};
    }
    return [options, callback]; // Both params
}
function parseArguments(options, callback) {
    if (_.isUndefined(options) && _.isUndefined(callback)) { // No params
        return [{}, undefined];
    }
    if (!_.isUndefined(options) && _.isFunction(options)) { // Only callback param
        callback = options;
        options = {};
    }
    return [options, callback]; // Both params
}
function parseArguments ( options , callback ) { if ( _ . isUndefined ( options ) && _ . isUndefined ( callback ) ) { // No params return [ { } , undefined ] ; } if ( ! _ . isUndefined ( options ) && _ . isFunction ( options ) ) { // Only callback param callback = options ; options = { } ; } return [ options , callback ] ; // Both params }
Parses arguments provided, makes it possible to only apply a callback function
Parses arguments provided makes it possible to only apply a callback function