mirror of
https://github.com/CommunityOx/ox_lib.git
synced 2026-08-18 15:36:02 +01:00
feat(class): add instanceOf method
This commit is contained in:
@@ -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