inspect

Interact with tables

Functions:

Inspect

inspect(table: value, table: options)

Parameters:

  • value (any) The value to inspect.

  • options (table, optional) Controls formatting and processing.

    • depth (number) Maximum depth to display nested tables (default: math.huge).

    • newline (string) String used for new lines (default: "\n").

    • indent (string) Indentation string per nesting level (default: " ").

    • process (function) A function to preprocess items before printing.

Returns: The formatted string representation.

Example:

local t = {1, 2, {3, 4, 5}}
print(inspect(t))

Output:

{ 1, 2, { 3, 4, 5 } }

Last updated