global plugin_template._core.tabler
methods
M.get_slice
function M.get_slice(
table_: table<any,any>,
first: number?,
last: number?,
step: number?
) -> The table<any,any>
@param table_
- A list / array / dictionary / sequence to copy + reduce.
@param first
- The start index to use. This value is inclusive (the given index
will be returned). Uses table_
's first index if not provided.
@param last
- The end index to use. This value is inclusive (the given index will
be returned). Uses every index to the end of table_
' if not provided.
@param step
- The step size between elements in the slice. Defaults to 1 if not provided.
@return The
- subset of table_
.
Get a sub-section copy of table_
as a new table.
M.get_value
function M.get_value(
data: any,
items: string[]
) -> any
@param data
- Some nested data to query. e.g. {a={b={c=true}}}
.
@param items
- Some attributes to query. e.g. {"a", "b", "c"}
.
@return - The found value, if any.
Access the attribute(s) within data
from items
.
M.chain
function M.chain(...: table<any,any>[]) -> any
@param ...
- All of the tables to expand
@return - Every element of each table, in order.
Iterate over all of the given arrays.
M.clear
function M.clear(data: table<any,any>) -> nil
@param data
- A dictionary or array to clear.
Delete the contents of data
.
M.extend
function M.extend(
table_: any[],
items: any
) -> nil
@param table_
- Any values to add.
@param items
- The values to add.
Append all of items
to table_
.
M.reverse_array
function M.reverse_array(array: table<any,any>) -> table<any,any>
@param array
- Some (non-dictionary) items e.g. {"a", "b", "c"}
.
@return - The reversed items e.g. {"c", "b", "a"}
.
Create a copy of array
with its items in reverse order.