export const toObject = (map: Map): Record => { return Object.fromEntries(map.entries()); }; export const toArray = (map: Map): [string, T][] => { return Array.from(map.entries()); };