import type { Reducer } from "./api.js" ; import { $$reduce , reducer } from "./reduce.js" ; param offset param step export function count ( offset ? , step ? ) ; export function count ( xs ) ; export function count ( offset , xs ) ; export function count ( offset , step , xs ) ; export function count ( ... args ) { const res = $$reduce ( count , args ) ; if ( res !== undefined ) { return res ; } let offset = args [ 0 ] || 0 ; let step = args [ 1 ] || 1 ; return reducer ( ( ) => offset , ( acc , _ ) => acc + step ) ; }