"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.sortBySemverChange = exports.DEFAULT_COMPARATORS = void 0;
/**
 * Default comparators used as the argument to `ramda.sortWith()`.
 */
exports.DEFAULT_COMPARATORS = [
    sortBySemverChange,
    (o1, o2) => o1.packageName.localeCompare(o2.packageName),
    (o1, o2) => (o1.current && o2.current && o1.current.localeCompare(o2.current)) || 0,
];
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;
    }
}
//# sourceMappingURL=utils.js.map