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