1 var compareAscending = require(
'./_compareAscending');
17 function compareMultiple(
object, other, orders) {
19 objCriteria =
object.criteria,
20 othCriteria = other.criteria,
21 length = objCriteria.length,
22 ordersLength = orders.length;
24 while (++index < length) {
25 var result = compareAscending(objCriteria[index], othCriteria[index]);
27 if (index >= ordersLength) {
30 var order = orders[index];
31 return result * (order ==
'desc' ? -1 : 1);
41 return object.index - other.index;
44 module.exports = compareMultiple;