We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent f804a7e commit b31f804Copy full SHA for b31f804
modules/lib.lua
@@ -4,6 +4,7 @@ local qbx = {}
4
qbx.string = {}
5
qbx.math = {}
6
qbx.table = {}
7
+qbx.array = {}
8
9
qbx.armsWithoutGloves = lib.table.freeze({
10
male = lib.table.freeze({
@@ -147,6 +148,21 @@ function qbx.table.mapBySubfield(tble, subfield)
147
148
return map
149
end
150
151
+---Returns true if the given array contains the given value.
152
+---@generic T
153
+---@param arr T[]
154
+---@param val T
155
+---@return boolean
156
+function qbx.array.contains(arr, val)
157
+ for i = 1, #arr do
158
+ if arr[i] == val then
159
+ return true
160
+ end
161
162
+
163
+ return false
164
+end
165
166
---Returns the number plate of the given vehicle.
167
---@param vehicle integer
168
---@return string?
0 commit comments