@reactivex/ix-es5-esm
Version:
The Interactive Extensions for JavaScript
18 lines (16 loc) • 858 B
JavaScript
import { extremaBy } from './_extremaby.js';
import { equalityComparer } from '../util/comparer.js';
/**
* Returns the elements in an iterable sequence with the maximum key value.
*
* @template TSource The type of the elements in the source sequence.
* @template TKey The type of the key computed for each element in the source sequence.
* @param {Iterable<TSource>} source The source to get the maximum by.
* @param {ExtremaOptions<TSource, TKey>} [options] The options which include an optional comparer.
* @returns {TSource[]} A list of zero or more elements that have a maximum key value.
*/
export function maxBy(source, options) {
var _a = options || {}, _b = _a["comparer"], comparer = _b === void 0 ? equalityComparer : _b, selector = _a["selector"];
return extremaBy(source, selector, comparer);
}
//# sourceMappingURL=maxby.js.map