Modul:Utils: Unterschied zwischen den Versionen

Aus Eco - Deutsches Wiki
Wechseln zu:Navigation, Suche
(Die Seite wurde neu angelegt: „local p = {} -- Trims and parses the args into a table, then returns the table function p.normaliseArgs(frame) local origArgs = frame:getParent().args loc…“)
(kein Unterschied)

Version vom 21. Februar 2021, 12:06 Uhr

Die Dokumentation für dieses Modul kann unter Modul:Utils/Doku erstellt werden

local p = {}

-- Trims and parses the args into a table, then returns the table
function p.normaliseArgs(frame)
  local origArgs = frame:getParent().args
  local args = {}

  for k, v in pairs(origArgs) do
    v = mw.text.trim(tostring(v))
    if v ~= '' then
      args[k] = v
    end
  end

  return args
end

return p