feat(es_extended/shared/functions): add ESX.IsFunctionReference

This commit is contained in:
Ilias Rbayti
2024-11-27 21:36:54 +01:00
parent 7585270e50
commit 5392f38c7a
+7
View File
@@ -164,3 +164,10 @@ function ESX.AssertType(...)
return matches
end
---@param val unknown
function ESX.IsFunctionReference(val)
local typeVal = type(val)
return typeVal == "function" or (typeVal == "table" and type(getmetatable(val)?.__call) == "function")
end