Module:Util/tables/iteratee/Documentation/Snippets: Difference between revisions

From Zelda Wiki, the Zelda encyclopedia
Jump to navigation Jump to search
No edit summary
No edit summary
 
(No difference)

Latest revision as of 21:27, 12 May 2024

Documentation for this module may be created at Module:Util/tables/iteratee/Documentation/Snippets/Documentation

local p = {}

local util = {
	tables = {
		iteratee = require("Module:Util/tables/iteratee")
	}
}

function p.iterateeStr1()
	local game = {
		abbr = "OoA", 
		title = "Oracle of Ages",
	}
	local iteratee = util.tables.iteratee("abbr")
	return iteratee(game)
end

function p.iterateeStr2()
	local game = {
		title = "Bayonetta",
	}
	local iteratee = util.tables.iteratee("abbr")
	return iteratee(game)
end

function p.iterateeTbl1()
	local game = {
		abbr = "OoA",
		title = "Oracle of Ages",
	}
	local iteratee = util.tables.iteratee({ abbr = "OoA" })
	return iteratee(game)
end

function p.iterateeTbl2()
	local game = {
		abbr = "OoA",
		title = "Oracle of Ages",
	}
	local iteratee = util.tables.iteratee({ abbr = "OoS" })
	return iteratee(game)
end

return p