import type { Transducer } from "./api.js" ; import { __iter } from "./iterator.js" ; import { mapIndexed } from "./map-indexed.js" ; export function indexed < T > ( from ? ) ; export function indexed < T > ( src ) ; export function indexed < T > ( from , src ) ; export function indexed < T > ( ... args ) { const iter = __iter ( indexed , args ) ; if ( iter ) { return iter ; } const from = args [ 0 ] || 0 ; return mapIndexed ( ( i , x ) => [ from + i , x ] ) ; }