lib/utils.js
function getOptions(sources, keys, dest) {
    var options = dest || { };

    // allow source be an array
    if (!_.isArray(sources)) {
        sources = [ sources ];
    }

    // using the keys for lookup
    keys.forEach(function(key) {
        // from each source
        sources.forEach(function(source) {
            if (source && source[key]) {
                options[key] = source[key];
            }
        });
    });

    return options;
}
function getOptions(sources, keys, dest) {
    var options = dest || { };

    // allow source be an array
    if (!_.isArray(sources)) {
        sources = [ sources ];
    }

    // using the keys for lookup
    keys.forEach(function(key) {
        // from each source
        sources.forEach(function(source) {
            if (source && source[key]) {
                options[key] = source[key];
            }
        });
    });

    return options;
}
function getOptions ( sources , keys , dest ) { var options = dest || { } ; // allow source be an array if ( ! _ . isArray ( sources ) ) { sources = [ sources ] ; } // using the keys for lookup keys . forEach ( function ( key ) { // from each source sources . forEach ( function ( source ) { if ( source && source [ key ] ) { options [ key ] = source [ key ] ; } } ) ; } ) ; return options ; }
Return an object with key-value pairs, using keys, from an object

@param {Object|Object[]} sources - object(s) to look for the properties
@param {Array} keys - an array of keys of the properties to look up
@param {Object} [dest] - destination object
@return {Object} options
Return an object with key - value pairs using keys from an object