blob: 40b3e88840d91bfa490473fe00da8b57a29d5d87 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
local function is_required()
local n = 0
local res = false
while true do
local x = debug.getinfo(n)
if x == nil then break end
n = n + 1
if x.name == 'require' then
res = true
break
end
end
return res
end
return {is_required = is_required}
|