ferron

Ferron is a fast and simple static website generator made with Lua.
Log | Files | Refs | Submodules | README | LICENSE

commit fa0f95b3b7e30e66e898da7ef304bd36d3e46684
parent ff9a9e238ad45a60d63f7d765d8859cfddec3d1f
Author: Hugo Soucy <hsoucy@kronostechnologies.com>
Date:   Thu, 11 Oct 2018 13:17:43 -0400

Add a extend table method

Diffstat:
Mferron/utilities/table-utils.lua | 13+++++++++++++
1 file changed, 13 insertions(+), 0 deletions(-)

diff --git a/ferron/utilities/table-utils.lua b/ferron/utilities/table-utils.lua @@ -68,4 +68,17 @@ function tableutils.length(tab) return count end +-- extend +function tableutils.extend(list, ...) + local lists = {...} + + for i, source in ipairs(lists) do + for k, v in pairs(source) do + list[k] = source[k] + end + end + + return list +end + return tableutils