import { wrapWithAbort } from './operators/withabort' ; import { throwIfAborted } from '../aborterror' ; import { FindOptions } from './findoptions' ; template T param { AsyncIterable < T > } source param { FindOptions < T > } options returns { Promise < boolean > } export async function every < T > ( source , options ) { const { [ 'signal' ] : signal , [ 'thisArg' ] : thisArg , [ 'predicate' ] : predicate } = options ; throwIfAborted ( signal ) ; let i = 0 ; for await ( const item of wrapWithAbort ( source , signal ) ) { if ( ! ( await predicate . call ( thisArg , item , i ++ , signal ) ) ) { return false ; } } return true ; }