Module:Table/listToSet

From The Languages of David J. Peterson
Jump to navigation Jump to search

Documentation for this module may be created at Module:Table/listToSet/documentation

--[[
	{ "a", "b", "c" } -> { ["a"] = true, ["b"] = true, ["c"] = true }
--]]
return function(t)
	-- checkType("listToSet", 1, t, "table")
	
	local set = {}
	for _, item in ipairs(t) do
		set[item] = true
	end
	return set
end