return function(...)
  require "configenv.setup" (...)
  require "configenv.range" (...)
  require "configenv.util" (...)
  return ...
end

local _safe_methods = {}
for v in string.gmatch([[
  string table math
  getmetatable
  ipairs next pairs
  rawequal rawget rawlen
  tonumber tostring type
]], "%S+") do
  safeMethods[v] = _G[v]
end

return function(tbl, ...)
  require "configenv.setup" (tbl, ...)
  require "configenv.range" (tbl, ...)
  require "configenv.util" (tbl, ...)
  return setmetatable(tbl, { __index = _safe_methods }), ...
end

Add safe Lua globals to config.
Add safe Lua globals to config.