import type { Predicate } from "@thi.ng/api" ; import type { Reducer , Transducer } from "./api.js" ; import { compR } from "./compr.js" ; import { __iter } from "./iterator.js" ; export function dropWhile < T > ( pred ? ) ; export function dropWhile < T > ( src ) ; export function dropWhile < T > ( pred , src ) ; export function dropWhile < T > ( ... args ) { return ( __iter ( dropWhile , args ) || ( ( rfn ) => { const r = rfn [ 2 ] ; const pred = args [ 0 ] ; let ok = true ; return compR ( rfn , ( acc , x ) => ( ok = ok && pred ( x ) ) ? acc : r ( acc , x ) ) ; } ) ) ; }