Documentation for this module may be created at Module:table/invert/doc
local pairs = pairs
--[==[
Invert a table. For example, {invert({ "a", "b", "c" })} -> { { a = 1, b = 2, c = 3 }}]==]
return function(t)
local map = {}
for k, v in pairs(t) do
map[v] = k
end
return map
end