Module:IfEmpty

From bg3.wiki
Revision as of 19:30, 23 July 2023 by Taylan (talk | contribs)
Jump to navigation Jump to search

This module implements the functionality of Template:IfEmpty. It returns the first template argument that's not empty or whitespace-only.


local p = {}

function p.main(frame)
	local args = require('Module:Arguments').getArgs(frame, {
		wrappers = 'Template:IfEmpty'
	})

	for k,v in ipairs(args) do
		if v ~= '' then
			return v
		end
	end
end

return p