-- Compiled with roblox-ts v1.2.7 --[[ * * Utilites relating to Map objects ]] local MapUtils = {} do local _container = MapUtils --[[ * * Creates a shallow copy of a map * @param map The map to copy * @returns A shallow copy of the map ]] local function Copy(map) local mapCopy = {} for k, v in pairs(map) do -- ▼ Map.set ▼ mapCopy[k] = v -- ▲ Map.set ▲ end return mapCopy end _container.Copy = Copy --[[ * * Gets the value of this map, or creates the key with the default value if it doesn't exist. * @param map The map * @param key The key to get the value or "place" a default value in * @param defaultValue The default value if the key doesn't exist (to set) * @returns The value ]] local function GetOrCreateKey(map, key, defaultValue) local value = map[key] if value ~= nil then return value else -- ▼ Map.set ▼ map[key] = defaultValue -- ▲ Map.set ▲ return defaultValue end end _container.GetOrCreateKey = GetOrCreateKey end return { MapUtils = MapUtils, }