"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/**
 * Default comparators used as the argument to `ramda.sortWith()`.
 */
exports.DEFAULT_COMPARATORS = [
    sortBySemverChange,
    (o1, o2) => o1.packageName.localeCompare(o2.packageName),
];
function sortBySemverChange(outdated1, outdated2) {
    return pkgPriority(outdated1) - pkgPriority(outdated2);
}
exports.sortBySemverChange = sortBySemverChange;
function pkgPriority(pkg) {
    switch (pkg.change) {
        case null: return 0;
        case 'fix': return 1;
        case 'feature': return 2;
        case 'breaking': return 3;
        default: return 4;
    }
}
