30 lines
720 B
JavaScript
30 lines
720 B
JavaScript
// Metro module 6707 (f6708).
|
|
import * as _compareAscending from "./compareAscending";
|
|
module.exports = function compareMultiple(a0, a1, a2) {
|
|
const criteria2 = a0.criteria;
|
|
const criteria = a1.criteria;
|
|
const length2 = criteria2.length;
|
|
const length = a2.length;
|
|
let r0 = 0;
|
|
const r5 = 0 < length2;
|
|
let r2 = 1;
|
|
if (r5) {
|
|
do {
|
|
const r20 = _compareAscending(criteria2[r0], criteria[r0]);
|
|
const r1 = r0;
|
|
if (r20) {
|
|
let r24 = r20;
|
|
if (!(r1 >= length)) {
|
|
if (a2[r1] == "desc") {
|
|
r2 = -1;
|
|
}
|
|
r24 = r20 * r2;
|
|
}
|
|
return r24;
|
|
}
|
|
r0 = r1 + 1;
|
|
} while (r0 < length2);
|
|
}
|
|
return a0.index - a1.index;
|
|
};
|