function (pkgDepths) {
        // pkgDepths -> depth: [metas]
        var depths,
            minDepth,
            maxDepth,
            seeds;
        depths = Object.keys(pkgDepths);
        minDepth = Math.min.apply(Math, depths);
        maxDepth = Math.max.apply(Math, depths);
        seeds = pkgDepths[minDepth];
        if (1 === seeds.length) {
            if (minDepth !== maxDepth) {
                debug('multiple "' + seeds[0].name + '" packages found, using version ' +
                    seeds[0].version + ' from ' + seeds[0].baseDirectory);
            }
            return seeds[0];
        }
        seeds.sort(function (a, b) {
            return libsemver.rcompare(a.version, b.version);
        });
        debug('multiple "' + seeds[0].name + '" packages found, using version ' +
            seeds[0].version + ' from ' + seeds[0].baseDirectory);
        return seeds[0];
    }
function (pkgDepths) {
        // pkgDepths -> depth: [metas]
        var depths,
            minDepth,
            maxDepth,
            seeds;
        depths = Object.keys(pkgDepths);
        minDepth = Math.min.apply(Math, depths);
        maxDepth = Math.max.apply(Math, depths);
        seeds = pkgDepths[minDepth];
        if (1 === seeds.length) {
            if (minDepth !== maxDepth) {
                debug('multiple "' + seeds[0].name + '" packages found, using version ' +
                    seeds[0].version + ' from ' + seeds[0].baseDirectory);
            }
            return seeds[0];
        }
        seeds.sort(function (a, b) {
            return libsemver.rcompare(a.version, b.version);
        });
        debug('multiple "' + seeds[0].name + '" packages found, using version ' +
            seeds[0].version + ' from ' + seeds[0].baseDirectory);
        return seeds[0];
    }
function ( pkgDepths ) { // pkgDepths -> depth: [metas] var depths , minDepth , maxDepth , seeds ; depths = Object . keys ( pkgDepths ) ; minDepth = Math . min . apply ( Math , depths ) ; maxDepth = Math . max . apply ( Math , depths ) ; seeds = pkgDepths [ minDepth ] ; if ( 1 === seeds . length ) { if ( minDepth !== maxDepth ) { debug ( 'multiple "' + seeds [ 0 ] . name + '" packages found, using version ' + seeds [ 0 ] . version + ' from ' + seeds [ 0 ] . baseDirectory ) ; } return seeds [ 0 ] ; } seeds . sort ( function ( a , b ) { return libsemver . rcompare ( a . version , b . version ) ; } ) ; debug ( 'multiple "' + seeds [ 0 ] . name + '" packages found, using version ' + seeds [ 0 ] . version + ' from ' + seeds [ 0 ] . baseDirectory ) ; return seeds [ 0 ] ; }
Figures out which seed to use from the list of available packages.
Select by depth, then by semver.
@private
@method _dedupeSeeds
@param {object} pkgDepths List of seed by deep.
@return {object} The metas of the selected package.
Figures out which seed to use from the list of available packages . Select by depth then by semver .