Skip to content

Commit

Permalink
fix(client/api): checkOptions types
Browse files Browse the repository at this point in the history
  • Loading branch information
thelindat committed May 10, 2024
1 parent 859ed8c commit 2ca72a7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions client/api.lua
Expand Up @@ -19,10 +19,11 @@ local function typeError(variable, expected, received)
end

---Checks options and throws an error on type mismatch
---@param options? OxTargetOption | OxTargetOption[]
---@param options OxTargetOption | OxTargetOption[]
---@return OxTargetOption[]
local function checkOptions(options)
local optionsType = type(options)

if optionsType ~= 'table' then
typeError('options', 'table', optionsType)
end
Expand All @@ -35,7 +36,7 @@ local function checkOptions(options)
typeError('options', 'array', ('%s table'):format(tableType))
end

return options --[[ @as OxTargetOption[] ]]
return options
end

---@param data OxTargetPolyZone | table
Expand Down

0 comments on commit 2ca72a7

Please sign in to comment.