export function set < TKey , TValue > ( map , key , value ) { const newMap = new Map ( map ) ; newMap . set ( key , value ) ; return newMap ; } export function del < TKey , TValue > ( map , key ) { const newMap = new Map ( map ) ; newMap . delete ( key ) ; return newMap ; } export function firstEntry < TKey , TValue > ( map ) { return map . entries ( ) . next ( ) . value ; } export function firstKey < TKey , TValue > ( map ) { return map . keys ( ) . next ( ) . value ; } export function getKeyByIndex < TKey , TValue > ( map , index ) { return Array . from ( map . keys ( ) ) [ index ] ; } export function valuesAsArray < TKey , TValue > ( map ) { return Array . from ( map . values ( ) ) ; }