return table details in docs
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
This commit is contained in:
@@ -3,16 +3,16 @@
|
||||
|
||||
--- Safely wraps an index for an array.
|
||||
--- @within Util
|
||||
-- @param array table The array to index.
|
||||
-- @param index number The desired index (can be out of bounds).
|
||||
-- @return number The wrapped index within the array's bounds.
|
||||
--- @param array table The array to index.
|
||||
--- @param index number The desired index (can be out of bounds).
|
||||
--- @return number The wrapped index within the array's bounds.
|
||||
function Util.safeindex(array, index)
|
||||
return ((index - 1 + #array) % #array) + 1
|
||||
end
|
||||
|
||||
--- Navigates to a screen by its ID.
|
||||
--- @within Util
|
||||
-- @param screen_id string The ID of the screen to go to.
|
||||
--- @param screen_id string The ID of the screen to go to.
|
||||
function Util.go_to_screen_by_id(screen_id)
|
||||
local screen = Screen.get_by_id(screen_id)
|
||||
if screen then
|
||||
@@ -25,8 +25,8 @@ end
|
||||
|
||||
--- Checks if a table contains a specific value.
|
||||
--- @within Util
|
||||
-- @param t table The table to check.
|
||||
-- @param value any The value to look for.
|
||||
--- @param t table The table to check.
|
||||
--- @param value any The value to look for.
|
||||
function Util.contains(t, value)
|
||||
for i = 1, #t do
|
||||
if t[i] == value then
|
||||
|
||||
Reference in New Issue
Block a user