Method to compare two prioritized objects to sort them by ascending priority (thus descending number). Note that the sort order adapts the number representation for high and low priorities as defined by CKEditor's PriorityString.
PriorityString
first prioritized object
second prioritized object
const objs: Prioritized[] = [ {priority: -2}, {priority: 2}, {priority: -1}, {priority: 1}, {priority: 0},];objs.sort(byPriority);// [2, 1, 0, -1, -2] Copy
const objs: Prioritized[] = [ {priority: -2}, {priority: 2}, {priority: -1}, {priority: 1}, {priority: 0},];objs.sort(byPriority);// [2, 1, 0, -1, -2]
Method to compare two prioritized objects to sort them by ascending priority (thus descending number). Note that the sort order adapts the number representation for high and low priorities as defined by CKEditor's
PriorityString
.