mirror of
https://github.com/CommunityOx/ox_lib.git
synced 2026-11-27 21:04:45 +00:00
feat(class): add instanceOf method
This commit is contained in:
1 parent
d806668c65
commit
de49dff9b0
1 file changed
+5
@@ -37,6 +37,11 @@ function mixins.new(class, obj)
|
|||||||
return obj
|
return obj
|
||||||
end
|
end
|
||||||
|
|
||||||
|
---Checks if an object is an instance of the given class.
|
||||||
|
function mixins.instanceOf(obj, class)
|
||||||
|
return getmetatable(obj) == class
|
||||||
|
end
|
||||||
|
|
||||||
---Creates a new class.
|
---Creates a new class.
|
||||||
---@todo add inherited types for new/private/init fields (not yet supported by lls)
|
---@todo add inherited types for new/private/init fields (not yet supported by lls)
|
||||||
---@param name string
|
---@param name string
|
||||||
|
|||||||
Reference in new issue
Block a user