mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-08-29 02:01:31 +00:00
feat(es_extended/shared/functions): add ESX.IsFunctionReference
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user