Module utils
Utils Helper module for misc operations
Functions
Utils.shallowCopy (orig, target) | Does a shallow copy of a table and appends it to a target table. |
Utils.loadNamespace (pathOrFiles, namespace) | Requires files and puts them in a table. |
Functions
- Utils.shallowCopy (orig, target)
-
Does a shallow copy of a table and appends it to a target table.
Parameters:
- orig Table to copy
- target Table to append to
- Utils.loadNamespace (pathOrFiles, namespace)
-
Requires files and puts them in a table.
Accepts a table of paths to Lua files: {"path/to/file_1", "path/to/another/file_2", "etc"}
Accepts a path to a directory with Lua files: "my_files/here"
Parameters:
- pathOrFiles The table of paths or a path to a directory.
- namespace A table that will hold the required files
Returns:
-
table
The namespace table