mod_admin_telnet: Identify native bidi sessions
[prosody.git] / util / import.lua
blob1007bc0a5c96b3fc0303328af462e2bc43a44aeb
1 -- Prosody IM
2 -- Copyright (C) 2008-2010 Matthew Wild
3 -- Copyright (C) 2008-2010 Waqas Hussain
4 --
5 -- This project is MIT/X11 licensed. Please see the
6 -- COPYING file in the source package for more information.
7 --
11 local unpack = table.unpack or unpack; --luacheck: ignore 113
12 local t_insert = table.insert;
13 function _G.import(module, ...)
14 local m = package.loaded[module] or require(module);
15 if type(m) == "table" and ... then
16 local ret = {};
17 for _, f in ipairs{...} do
18 t_insert(ret, m[f]);
19 end
20 return unpack(ret);
21 end
22 return m;
23 end