lib/detect.js
function (a, b) {
    var aNeedsB = false;
    var bNeedsA = false;

    aNeedsB = Object.
    keys(a.dependencies).
    some(function (dependency) {
        return dependency === b.name;
    });

    if (aNeedsB) {
        return 1;
    }

    bNeedsA = Object.
    keys(b.dependencies).
    some(function (dependency) {
        return dependency === a.name;
    });

    if (bNeedsA) {
        return -1;
    }

    return 0;
}
function (a, b) {
    var aNeedsB = false;
    var bNeedsA = false;

    aNeedsB = Object.
    keys(a.dependencies).
    some(function (dependency) {
        return dependency === b.name;
    });

    if (aNeedsB) {
        return 1;
    }

    bNeedsA = Object.
    keys(b.dependencies).
    some(function (dependency) {
        return dependency === a.name;
    });

    if (bNeedsA) {
        return -1;
    }

    return 0;
}
function ( a , b ) { var aNeedsB = false ; var bNeedsA = false ; aNeedsB = Object . keys ( a . dependencies ) . some ( function ( dependency ) { return dependency === b . name ; } ) ; if ( aNeedsB ) { return 1 ; } bNeedsA = Object . keys ( b . dependencies ) . some ( function ( dependency ) { return dependency === a . name ; } ) ; if ( bNeedsA ) { return - 1 ; } return 0 ; }
Compare two dependencies to determine priority.

@param  {object} a  dependency a
@param  {object} b  dependency b
@return {number} the priority of dependency a in comparison to dependency b
Compare two dependencies to determine priority .