summaryrefslogtreecommitdiff
path: root/is_required.lua
blob: e82347ddb3d6d350c8005032eeec0088d6b03c35 (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.func == require then
			res = true
		
			break
		end
	end
	return res
end
return {is_required = is_required}