import { isIterable } from "@thi.ng/checks/is-iterable" ; import type { Reducer , Transducer } from "./api.js" ; import { compR } from "./compr.js" ; import { iterator1 } from "./iterator.js" ; export function drop < T > ( n ) ; export function drop < T > ( n , src ) ; export function drop < T > ( n , src ? ) { return isIterable ( src ) ? iterator1 ( drop ( n ) , src ) : ( rfn ) => { const r = rfn [ 2 ] ; let m = n ; return compR ( rfn , ( acc , x ) => m > 0 ? ( m -- , acc ) : r ( acc , x ) ) ; } ; }