2 * Compares values to sort them in ascending order.
5 * @param {*} value The value to compare.
6 * @param {*} other The other value to compare.
7 * @returns {number} Returns the sort order indicator for `value`.
9 function compareAscending(value, other) {
10 if (value !== other) {
11 var valIsNull = value === null,
12 valIsUndef = value === undefined,
13 valIsReflexive = value === value;
15 var othIsNull = other === null,
16 othIsUndef = other === undefined,
17 othIsReflexive = other === other;
19 if ((value > other && !othIsNull) || !valIsReflexive ||
20 (valIsNull && !othIsUndef && othIsReflexive) ||
21 (valIsUndef && othIsReflexive)) {
24 if ((value < other && !valIsNull) || !othIsReflexive ||
25 (othIsNull && !valIsUndef && valIsReflexive) ||
26 (othIsUndef && valIsReflexive)) {
33 module.exports = compareAscending;