export type Iteratee < V , K , O , R > = ( value : V , key : K , source : O ) => R ; /**
 * A specialized version of `forEach` for arrays.
 *
 * From lodash.
 */ function arrayEach < T > ( array , iteratee ) { let index = - 1 ; const length = array . length ; while ( ++ index < length ) { if ( iteratee ( array [ index ] , index , array ) === false ) { break ; } } return array ; } /**
 * A specialized version of `forEach` for objects.
 */ function objectEach < T > ( source , iteratee ) { for ( let key in source ) { if ( source . hasOwnProperty ( key ) ) { if ( iteratee ( source [ key ] , key , source ) === false ) { break ; } } } return source ; } /**
 * Invokes the iteratee for each item in the array or object.
 */ export function forEach < T > ( array , iteratee ) ; export function forEach < T > ( source , iteratee ) ; export function forEach ( source , iteratee ) { const func = Array . isArray ( source ) ? arrayEach : objectEach ; return func ( source , iteratee ) ; } type { T [ ] } export function every < T > ( array , predicate ) ; export function every < T > ( source , predicate ) ; export function every ( source , predicate ) { let result = true ; forEach ( source , ( value , key , source ) => { if ( ! predicate ( value , key , source ) ) { result = false ; return false ; } } ) ; return result ; }