refactor(class): disable experimental warning for internal modules

This warning is only important for 3rd party users.
This commit is contained in:
Linden
2024-06-01 21:43:42 +10:00
parent 09ba32342c
commit 54b7701c36

View File

@@ -1,5 +1,9 @@
---@diagnostic disable: invisible
lib.print.warn('ox_lib\'s class module is experimental and may break without warning.')
local getinfo = debug.getinfo
if not getinfo(1, 'S').source:match('^@@ox_lib') then
lib.print.warn('ox_lib\'s class module is experimental and may break without warning.')
end
---Ensure the given argument or property has a valid type, otherwise throwing an error.
---@param id number | string
@@ -31,7 +35,6 @@ end
---@field protected constructor? OxClassConstructor
local mixins = {}
local constructors = {}
local getinfo = debug.getinfo
---Somewhat hacky way to remove the constructor from the class.__index.
---Maybe add static fields in the future?