Jump to content

မေႃႇၵျူး:utilities/set

လုၵ်ႉတီႈ ဝိၵ်ႇသျိၼ်ႇၼရီႇ မႃး

Documentation for this module may be created at မေႃႇၵျူး:utilities/set/doc

local type = type

return function(list, value)
	value = value or true
	local set = {}
	if type(value) == "function" then
		for i = 1, #list do
			local item = list[i]
			set[item] = value(item)
		end
	else
		for i = 1, #list do
			set[list[i]] = value
		end
	end
	return set
end