Module:Set to list

-- Converts a set (table with values as true) to a list (array of keys)

return function (set)

local list = {}

for key, value in pairs(set) do

if value then

table.insert(list, key)

end

end

table.sort(list)

return list

end