'use strict'; /** * Create a map with unique sets of values from a record. * * @template T * @param {Record} record * @returns {Map>} */ module.exports = function createMapWithSet(record) { /** @type {Map>} */ const map = new Map(); for (const [key, value] of Object.entries(record)) { const list = Array.isArray(value) ? value : [value]; map.set(key, new Set(list)); } return map; };