import type { IObjectOf } from "@thi.ng/api" ; import type { Reducer } from "./api.js" ; import { reduce , reducer } from "./reduce.js" ; example param prefix param xs export function autoObj < T > ( prefix ) ; export function autoObj < T > ( prefix , xs ) ; export function autoObj < T > ( prefix , xs ? ) { let id = 0 ; return xs ? reduce ( autoObj ( prefix ) , xs ) : reducer < IObjectOf < T > , T > ( ( ) => ( { } ) , ( acc , v ) => ( ( acc [ prefix + id ++ ] = v ) , acc ) ) ; }