lua-astra 0.25.0

🔥 Blazingly Fast 🔥 web server runtime for Lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
---@meta

_G.import = require

---@param modName string
function _G.import(modName)
	---@diagnostic disable-next-line: param-type-mismatch, undefined-global
	local ok, result = pcall(astra_internal__import, modName)
	if not ok then
		ok, result = require(modName)
		if not ok then
			error("Failed to load module.\nError: " .. result)
		end
		return result
	end
	return result
end