aboutsummaryrefslogtreecommitdiffstats
path: root/util/import.lua
blob: 6aab0d459490d5e893e254a3617e0b42fc752443 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13

local t_insert = table.insert;
function import(module, ...)
	local m = package.loaded[module] or require(module);
	if type(m) == "table" and ... then
		local ret = {};
		for _, f in ipairs{...} do
			t_insert(ret, m[f]);
		end
		return unpack(ret);
	end
	return m;
end