export async function asyncFilter < T > ( array , predicate , thisArg ? ) { const indications = await Promise . all ( array . map ( predicate , thisArg ) ) ; return array . filter ( ( _value , index ) => indications [ index ] ) ; } export async function asyncFind < T > ( array , predicate , thisArg ? ) { for ( let i = 0 ; i < array . length ; i ++ ) { const element = array [ i ] ; if ( await predicate . call ( thisArg , element , i , array ) ) { return element ; } } return undefined ; } export async function asyncSome < T > ( array , predicate , thisArg ? ) { for ( let i = 0 ; i < array . length ; i ++ ) { const element = array [ i ] ; if ( await predicate . call ( thisArg , element , i , array ) ) { return true ; } } return false ; }