Show raw api
{
"functions": [
{
"name": "append",
"desc": "Concats `target` with `source`",
"params": [
{
"name": "target",
"desc": "Table to append to",
"lua_type": "table"
},
{
"name": "source",
"desc": "Table read from",
"lua_type": "table"
}
],
"returns": [
{
"desc": "",
"lua_type": "table parameter table"
}
],
"function_type": "static",
"source": {
"line": 18,
"path": "src/shared/modules/tableUtil.lua"
}
},
{
"name": "merge",
"desc": "Shallow merges two tables without modifying either",
"params": [
{
"name": "orig",
"desc": "original table",
"lua_type": "table"
},
{
"name": "new",
"desc": "new table",
"lua_type": "table"
}
],
"returns": [
{
"desc": "",
"lua_type": "table"
}
],
"function_type": "static",
"source": {
"line": 32,
"path": "src/shared/modules/tableUtil.lua"
}
},
{
"name": "mergeLists",
"desc": "Shallow merges two lists without modifying either",
"params": [
{
"name": "orig",
"desc": "original table",
"lua_type": "table"
},
{
"name": "new",
"desc": "new table",
"lua_type": "table"
}
],
"returns": [
{
"desc": "",
"lua_type": "table"
}
],
"function_type": "static",
"source": {
"line": 49,
"path": "src/shared/modules/tableUtil.lua"
}
},
{
"name": "swapKeyValue",
"desc": "Swaps keys with v values, overwriting additional values if duplicated",
"params": [
{
"name": "orig",
"desc": "original table",
"lua_type": "table"
}
],
"returns": [
{
"desc": "",
"lua_type": "table"
}
],
"function_type": "static",
"source": {
"line": 65,
"path": "src/shared/modules/tableUtil.lua"
}
},
{
"name": "toList",
"desc": "Converts a table to a list",
"params": [
{
"name": "tab",
"desc": "Table to convert to a list",
"lua_type": "table"
}
],
"returns": [
{
"desc": "",
"lua_type": "table"
}
],
"function_type": "static",
"source": {
"line": 78,
"path": "src/shared/modules/tableUtil.lua"
}
},
{
"name": "count",
"desc": "Counts the number of items in `tab`.\nUseful since `__len` on table in Lua 5.2 returns just the array length.",
"params": [
{
"name": "tab",
"desc": "Table to count",
"lua_type": "table"
}
],
"returns": [
{
"desc": "count",
"lua_type": "number"
}
],
"function_type": "static",
"source": {
"line": 92,
"path": "src/shared/modules/tableUtil.lua"
}
},
{
"name": "copy",
"desc": "Copies a table, but not deep.",
"params": [
{
"name": "target",
"desc": "",
"lua_type": "table Table to copy"
}
],
"returns": [
{
"desc": "New table",
"lua_type": "table"
}
],
"function_type": "static",
"source": {
"line": 105,
"path": "src/shared/modules/tableUtil.lua"
}
},
{
"name": "deepCopy",
"desc": "Deep copies a table including metatables",
"params": [
{
"name": "target",
"desc": "Table to deep copy",
"lua_type": "table"
}
],
"returns": [
{
"desc": "New table",
"lua_type": "table"
}
],
"function_type": "static",
"source": {
"line": 118,
"path": "src/shared/modules/tableUtil.lua"
}
},
{
"name": "deepOverwrite",
"desc": "Overwrites a table's value",
"params": [
{
"name": "target",
"desc": "Target table",
"lua_type": "table"
},
{
"name": "source",
"desc": "Table to read from",
"lua_type": "table"
}
],
"returns": [
{
"desc": "target",
"lua_type": "table"
}
],
"function_type": "static",
"source": {
"line": 143,
"path": "src/shared/modules/tableUtil.lua"
}
},
{
"name": "getIndex",
"desc": "Gets an index by value, returning `nil` if no index is found.",
"params": [
{
"name": "haystack",
"desc": "table to search in",
"lua_type": "table"
},
{
"name": "needle",
"desc": "Value to search for",
"lua_type": "any"
}
],
"returns": [
{
"desc": "The index of the value, if found. Else nil.",
"lua_type": "number | nil"
}
],
"function_type": "static",
"source": {
"line": 161,
"path": "src/shared/modules/tableUtil.lua"
}
},
{
"name": "stringify",
"desc": "Recursively prints the table. Does not handle recursive tables.",
"params": [
{
"name": "table",
"desc": "Table to stringify",
"lua_type": "table"
},
{
"name": "indent",
"desc": "Indent level",
"lua_type": "number"
},
{
"name": "output",
"desc": "Output string, used recursively",
"lua_type": "string"
}
],
"returns": [
{
"desc": "",
"lua_type": "string The table in string form"
}
],
"function_type": "static",
"source": {
"line": 177,
"path": "src/shared/modules/tableUtil.lua"
}
},
{
"name": "contains",
"desc": "Returns whether `value` is within `table`",
"params": [
{
"name": "table",
"desc": "table to search in for value",
"lua_type": "table"
},
{
"name": "value",
"desc": "value to search for",
"lua_type": "any"
}
],
"returns": [
{
"desc": "",
"lua_type": "boolean `true` if within, `false` otherwise"
}
],
"function_type": "static",
"source": {
"line": 199,
"path": "src/shared/modules/tableUtil.lua"
}
},
{
"name": "overwrite",
"desc": "Overwrites an existing table",
"params": [
{
"name": "target",
"desc": "Table to overwrite",
"lua_type": "table"
},
{
"name": "source",
"desc": "Source table to read from",
"lua_type": "table"
}
],
"returns": [
{
"desc": "target",
"lua_type": "table"
}
],
"function_type": "static",
"source": {
"line": 215,
"path": "src/shared/modules/tableUtil.lua"
}
},
{
"name": "readOnly",
"desc": "Sets a metatable on a table such that it errors when\nindexing a nil value",
"params": [
{
"name": "table",
"desc": "Table to error on indexing",
"lua_type": "table"
}
],
"returns": [
{
"desc": "The same table",
"lua_type": "table"
}
],
"function_type": "static",
"source": {
"line": 229,
"path": "src/shared/modules/tableUtil.lua"
}
},
{
"name": "deepReadOnly",
"desc": "Recursively sets the table as ReadOnly",
"params": [
{
"name": "table",
"desc": "Table to error on indexing",
"lua_type": "table"
}
],
"returns": [
{
"desc": "The same table",
"lua_type": "table"
}
],
"function_type": "static",
"source": {
"line": 245,
"path": "src/shared/modules/tableUtil.lua"
}
}
],
"properties": [],
"types": [],
"name": "TableUtil",
"desc": "Provides a variety of utility Table operations\nTaken from Nevermore Framework:\n- https://github.com/Quenty/NevermoreEngine/blob/version2/Modules/Shared/Utility/Table.lua\n- https://github.com/Quenty/NevermoreEngine\n#### Edited by TheEpicTwin",
"source": {
"line": 9,
"path": "src/shared/modules/tableUtil.lua"
}
}