Module Table

A module with helper functions related to tables.

Info:

  • License: MIT
  • Author: Richard Voelker

Functions

ArrayToSingleLineString (array) Reads an array-like table and converts it into a single-line string.
HashMapToSingleLineString (map) Reads a HashMap and converts it into a single-line string.
HashMapToMultiLineString (map, depth) Returns a HashMap as a string representation across multiple lines.
TablesAreEqual (tableOne, tableTwo) Performs a deep comparison of two tables to check if they are equal.
Swap (t, i1, i2) Swap the values of two elements in a table.


Functions

ArrayToSingleLineString (array)
Reads an array-like table and converts it into a single-line string.

Parameters:

  • array table

    The array-like table to turn into a

    string.
    

Returns:

    string The array as a single-line string.
HashMapToSingleLineString (map)
Reads a HashMap and converts it into a single-line string.

Parameters:

Returns:

    string The HashMap as a single-line string.
HashMapToMultiLineString (map, depth)
Returns a HashMap as a string representation across multiple lines.

Parameters:

  • map HashMap The HashMap to turn into a string.
  • depth integer [opt=0] How many tabs to print at the start of the string.

Returns:

    string The HashMap as a multi-line string.
TablesAreEqual (tableOne, tableTwo)
Performs a deep comparison of two tables to check if they are equal.

Parameters:

  • tableOne table The first table to compare.
  • tableTwo table The second table to compare.

Returns:

    boolean True if the two tables are equal.
Swap (t, i1, i2)
Swap the values of two elements in a table.

Parameters:

  • t table The table to swap elements in.
  • i1 The key of the first element.
  • i2 The key of the second element.
generated by LDoc 1.4.3 Last updated 2016-07-26 17:10:04