|
@ -1488,17 +1488,19 @@ exports.topMost = function (pile, accessors) { |
|
|
accessors = [accessors]; |
|
|
accessors = [accessors]; |
|
|
} |
|
|
} |
|
|
for (const member of pile) { |
|
|
for (const member of pile) { |
|
|
candidate = member[accessors[0]]; |
|
|
|
|
|
for (let i = 1; i < accessors.length; i++){ |
|
|
|
|
|
|
|
|
if (member) { |
|
|
|
|
|
candidate = member[accessors[0]]; |
|
|
|
|
|
for (let i = 1; i < accessors.length; i++){ |
|
|
|
|
|
if (candidate) { |
|
|
|
|
|
candidate = candidate[accessors[i]] |
|
|
|
|
|
} else { |
|
|
|
|
|
continue; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
if (candidate) { |
|
|
if (candidate) { |
|
|
candidate = candidate[accessors[i]] |
|
|
|
|
|
} else { |
|
|
|
|
|
continue; |
|
|
|
|
|
|
|
|
break; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
if (candidate) { |
|
|
|
|
|
break; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
return candidate; |
|
|
return candidate; |
|
|
} |
|
|
|
|
|
|
|
|
}; |