a helper method that could be used in the library might look like:
local function isCallable(value)
if typeof(value) == "function" then
return true
end
if typeof(value) == "table" then
local mt = getmetatable(value)
if mt and rawget(mt, "__call") then
return true
end
end
return false
end
The library currently checks for:
which will fail for callable tables that use the __call metamethod, so this code fails the assertion above:
a helper method that could be used in the library might look like: