2 * The base implementation of `compareAscending` which compares values and
3 * sorts them in ascending order without guaranteeing a stable sort.
6 * @param {*} value The value to compare.
7 * @param {*} other The other value to compare.
8 * @returns {number} Returns the sort order indicator for `value`.
10 function baseCompareAscending(value, other) {
11 if (value !== other) {
12 var valIsNull = value === null,
13 valIsUndef = value === undefined,
14 valIsReflexive = value === value;
16 var othIsNull = other === null,
17 othIsUndef = other === undefined,
18 othIsReflexive = other === other;
20 if ((value > other && !othIsNull) || !valIsReflexive ||
21 (valIsNull && !othIsUndef && othIsReflexive) ||
22 (valIsUndef && othIsReflexive)) {
25 if ((value < other && !valIsNull) || !othIsReflexive ||
26 (othIsNull && !valIsUndef && valIsReflexive) ||
27 (othIsUndef && valIsReflexive)) {
34 module.exports = baseCompareAscending;