UNPKG

iter-tools-es

Version:
20 lines (17 loc) 525 B
const { asyncIterableCurry } = require('../../internal/async-iterable.js'); const { __asyncFindBestOr } = require('../$find-best-or/async-find-best-or.js'); async function __asyncFindBest(iterable, comparer, mapper = value => value) { return await __asyncFindBestOr(iterable, undefined, comparer, mapper); } exports.__asyncFindBest = __asyncFindBest; const asyncFindBest = asyncIterableCurry(__asyncFindBest, { reduces: true, minArgs: 1, maxArgs: 2, growRight: true }); exports.asyncFindBest = asyncFindBest;