1 var isSymbol = require(
'./isSymbol');
4 var MAX_ARRAY_LENGTH = 4294967295,
5 MAX_ARRAY_INDEX = MAX_ARRAY_LENGTH - 1;
8 var nativeFloor = Math.floor,
24 function baseSortedIndexBy(array, value, iteratee, retHighest) {
25 value = iteratee(value);
28 high = array == null ? 0 : array.length,
29 valIsNaN = value !== value,
30 valIsNull = value === null,
31 valIsSymbol = isSymbol(value),
32 valIsUndefined = value === undefined;
35 var mid = nativeFloor((low + high) / 2),
36 computed = iteratee(array[mid]),
37 othIsDefined = computed !== undefined,
38 othIsNull = computed === null,
39 othIsReflexive = computed === computed,
40 othIsSymbol = isSymbol(computed);
43 var setLow = retHighest || othIsReflexive;
44 }
else if (valIsUndefined) {
45 setLow = othIsReflexive && (retHighest || othIsDefined);
46 }
else if (valIsNull) {
47 setLow = othIsReflexive && othIsDefined && (retHighest || !othIsNull);
48 }
else if (valIsSymbol) {
49 setLow = othIsReflexive && othIsDefined && !othIsNull && (retHighest || !othIsSymbol);
50 }
else if (othIsNull || othIsSymbol) {
53 setLow = retHighest ? (computed <= value) : (computed < value);
61 return nativeMin(high, MAX_ARRAY_INDEX);
64 module.exports = baseSortedIndexBy;