export function arrayToMap < T , K > ( arr , kFn ) ; export function arrayToMap < T , K , V > ( arr , kFn , vFn ) ; param arr param kFn param vFn returns export function arrayToMap < T , K , V > ( arr , kFn , vFn = ( v ) => v as any ) { return arr . reduce ( ( res , item , index , arr ) => res . set ( kFn ( item , index , arr ) , vFn ( item , index , arr ) ) , new Map < K , V > ( ) ) ; }