mirror of
https://github.com/CommunityOx/ox_lib.git
synced 2026-08-18 23:46:03 +01:00
@@ -74,6 +74,10 @@ lib.callback = setmetatable({}, {
|
|||||||
else
|
else
|
||||||
local cbType = type(cb)
|
local cbType = type(cb)
|
||||||
|
|
||||||
|
if cbType == 'table' and getmetatable(cb)?.__call then
|
||||||
|
cbType = 'function'
|
||||||
|
end
|
||||||
|
|
||||||
assert(cbType == 'function', ("expected argument 3 to have type 'function' (received %s)"):format(cbType))
|
assert(cbType == 'function', ("expected argument 3 to have type 'function' (received %s)"):format(cbType))
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -57,6 +57,10 @@ lib.callback = setmetatable({}, {
|
|||||||
else
|
else
|
||||||
local cbType = type(cb)
|
local cbType = type(cb)
|
||||||
|
|
||||||
|
if cbType == 'table' and getmetatable(cb)?.__call then
|
||||||
|
cbType = 'function'
|
||||||
|
end
|
||||||
|
|
||||||
assert(cbType == 'function', ("expected argument 3 to have type 'function' (received %s)"):format(cbType))
|
assert(cbType == 'function', ("expected argument 3 to have type 'function' (received %s)"):format(cbType))
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user