<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://horizonffxi.wiki/w/index.php?action=history&amp;feed=atom&amp;title=Module%3ASandbox</id>
	<title>Module:Sandbox - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://horizonffxi.wiki/w/index.php?action=history&amp;feed=atom&amp;title=Module%3ASandbox"/>
	<link rel="alternate" type="text/html" href="https://horizonffxi.wiki/w/index.php?title=Module:Sandbox&amp;action=history"/>
	<updated>2026-04-07T12:23:18Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.10</generator>
	<entry>
		<id>https://horizonffxi.wiki/w/index.php?title=Module:Sandbox&amp;diff=19227&amp;oldid=prev</id>
		<title>Starfox9507: Replaced content with &quot;local getArgs = require(&#039;Module:Arguments&#039;).getArgs local p = {}  function p.main(frame) 	local args = getArgs(frame) 	return p._main(args) end  function p._main(args) 	local first = args[1] or &#039;&#039; 	local second = args[2] or &#039;&#039; 	return first .. &#039; &#039; .. second end  return p&quot;</title>
		<link rel="alternate" type="text/html" href="https://horizonffxi.wiki/w/index.php?title=Module:Sandbox&amp;diff=19227&amp;oldid=prev"/>
		<updated>2023-09-24T13:45:38Z</updated>

		<summary type="html">&lt;p&gt;Replaced content with &amp;quot;local getArgs = require(&amp;#039;Module:Arguments&amp;#039;).getArgs local p = {}  function p.main(frame) 	local args = getArgs(frame) 	return p._main(args) end  function p._main(args) 	local first = args[1] or &amp;#039;&amp;#039; 	local second = args[2] or &amp;#039;&amp;#039; 	return first .. &amp;#039; &amp;#039; .. second end  return p&amp;quot;&lt;/p&gt;
&lt;a href=&quot;https://horizonffxi.wiki/w/index.php?title=Module:Sandbox&amp;amp;diff=19227&amp;amp;oldid=15928&quot;&gt;Show changes&lt;/a&gt;</summary>
		<author><name>Starfox9507</name></author>
	</entry>
	<entry>
		<id>https://horizonffxi.wiki/w/index.php?title=Module:Sandbox&amp;diff=15928&amp;oldid=prev</id>
		<title>Starfox9507 at 04:40, 23 August 2023</title>
		<link rel="alternate" type="text/html" href="https://horizonffxi.wiki/w/index.php?title=Module:Sandbox&amp;diff=15928&amp;oldid=prev"/>
		<updated>2023-08-23T04:40:58Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;a href=&quot;https://horizonffxi.wiki/w/index.php?title=Module:Sandbox&amp;amp;diff=15928&amp;amp;oldid=15927&quot;&gt;Show changes&lt;/a&gt;</summary>
		<author><name>Starfox9507</name></author>
	</entry>
	<entry>
		<id>https://horizonffxi.wiki/w/index.php?title=Module:Sandbox&amp;diff=15927&amp;oldid=prev</id>
		<title>Starfox9507: Created page with &quot;--[[ {{Helper module |name=Paramtest |fname1 = is_empty(arg) |ftype1 = String |fuse1 = Returns true if arg is not defined or contains only whitespace |fname2 = has_content(arg) |ftype2 = String |fuse2 = Returns true if arg exists and does not only contain whitespace |fname3 = default_to(arg1,arg2) |ftype3 = String, Any value |fuse3 = If arg1 exists and does not only contain whitespace, the function returns arg1, otherwise returns arg2 |fname4 = defaults{ {arg1,arg2},...}...&quot;</title>
		<link rel="alternate" type="text/html" href="https://horizonffxi.wiki/w/index.php?title=Module:Sandbox&amp;diff=15927&amp;oldid=prev"/>
		<updated>2023-08-23T04:38:41Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;--[[ {{Helper module |name=Paramtest |fname1 = is_empty(arg) |ftype1 = String |fuse1 = Returns true if arg is not defined or contains only whitespace |fname2 = has_content(arg) |ftype2 = String |fuse2 = Returns true if arg exists and does not only contain whitespace |fname3 = default_to(arg1,arg2) |ftype3 = String, Any value |fuse3 = If arg1 exists and does not only contain whitespace, the function returns arg1, otherwise returns arg2 |fname4 = defaults{ {arg1,arg2},...}...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;--[[&lt;br /&gt;
{{Helper module&lt;br /&gt;
|name=Paramtest&lt;br /&gt;
|fname1 = is_empty(arg)&lt;br /&gt;
|ftype1 = String&lt;br /&gt;
|fuse1 = Returns true if arg is not defined or contains only whitespace&lt;br /&gt;
|fname2 = has_content(arg)&lt;br /&gt;
|ftype2 = String&lt;br /&gt;
|fuse2 = Returns true if arg exists and does not only contain whitespace&lt;br /&gt;
|fname3 = default_to(arg1,arg2)&lt;br /&gt;
|ftype3 = String, Any value&lt;br /&gt;
|fuse3 = If arg1 exists and does not only contain whitespace, the function returns arg1, otherwise returns arg2&lt;br /&gt;
|fname4 = defaults{ {arg1,arg2},...}&lt;br /&gt;
|ftype4 = {String, Any value}...&lt;br /&gt;
|fuse4 = Does the same as &amp;lt;code&amp;gt;default_to()&amp;lt;/code&amp;gt; run over every table passed&lt;br /&gt;
|fname5 = table_is_empty(arg)&lt;br /&gt;
|ftype5 = Table&lt;br /&gt;
|fuse5 = Returns true if the table has no content, it does not check if the content of the table contains anything&lt;br /&gt;
|fname6 = table_has_content(arg)&lt;br /&gt;
|ftype6 = Table&lt;br /&gt;
|fuse6 = returns true if the table has content, it does not check if the content of the table contains anything&lt;br /&gt;
}}&lt;br /&gt;
--]]&lt;br /&gt;
&lt;br /&gt;
local checkType, checkTypeForNamedArg&lt;br /&gt;
do&lt;br /&gt;
	local _libraryUtil = require(&amp;quot;libraryUtil&amp;quot;);&lt;br /&gt;
	checkType = _libraryUtil.checkType;&lt;br /&gt;
	checkTypeForNamedArg = _libraryUtil.checkTypeForNamedArg;&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--&lt;br /&gt;
-- Tests basic properties of parameters&lt;br /&gt;
--&lt;br /&gt;
&lt;br /&gt;
local p = {}&lt;br /&gt;
&lt;br /&gt;
--&lt;br /&gt;
-- Tests if the parameter is empty, all white space, or undefined&lt;br /&gt;
--&lt;br /&gt;
&lt;br /&gt;
function p.is_empty(arg)&lt;br /&gt;
	return not string.find(arg or &amp;#039;&amp;#039;, &amp;#039;%S&amp;#039;)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--&lt;br /&gt;
-- Tests if the table parameter is empty&lt;br /&gt;
--&lt;br /&gt;
&lt;br /&gt;
function p.table_is_empty(arg)&lt;br /&gt;
	for _, _ in pairs(arg) do&lt;br /&gt;
		return false&lt;br /&gt;
	end&lt;br /&gt;
	return true&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--&lt;br /&gt;
-- Returns the parameter if it has any content, the default (2nd param)&lt;br /&gt;
--&lt;br /&gt;
&lt;br /&gt;
function p.default_to(arg, default)&lt;br /&gt;
	if string.find(arg or &amp;#039;&amp;#039;, &amp;#039;%S&amp;#039;) then&lt;br /&gt;
		return arg&lt;br /&gt;
	else&lt;br /&gt;
		return default&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--&lt;br /&gt;
-- Returns a list of paramaters if it has any content, or the default&lt;br /&gt;
--&lt;br /&gt;
function p.defaults(args)&lt;br /&gt;
	checkType(&amp;quot;defaults&amp;quot;, 1, args, &amp;quot;table&amp;quot;);&lt;br /&gt;
	local ret = {}&lt;br /&gt;
	for i, v in ipairs(args) do&lt;br /&gt;
		checkTypeForNamedArg(&amp;quot;defaults&amp;quot;, i, v, &amp;quot;table&amp;quot;);&lt;br /&gt;
		ret[i] = p.default_to(v[1], v[2]);&lt;br /&gt;
	end&lt;br /&gt;
	return unpack(ret, 1, #args);&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--&lt;br /&gt;
-- Tests if the parameter has content&lt;br /&gt;
-- The same as !is_empty, but this is more readily clear&lt;br /&gt;
--&lt;br /&gt;
&lt;br /&gt;
function p.has_content(arg)&lt;br /&gt;
	return string.find(arg or &amp;#039;&amp;#039;, &amp;#039;%S&amp;#039;)&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--&lt;br /&gt;
-- Tests if the table parameter has content&lt;br /&gt;
-- The same as !table_is_empty, but this is more readily clear&lt;br /&gt;
--&lt;br /&gt;
&lt;br /&gt;
function p.table_has_content(arg)&lt;br /&gt;
	for _, _ in pairs(arg) do&lt;br /&gt;
		return true&lt;br /&gt;
	end&lt;br /&gt;
	return false&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--&lt;br /&gt;
-- uppercases first letter&lt;br /&gt;
--&lt;br /&gt;
&lt;br /&gt;
function p.ucfirst(arg)&lt;br /&gt;
	if not arg or arg:len() == 0 then&lt;br /&gt;
		return nil&lt;br /&gt;
	elseif arg:len() == 1 then&lt;br /&gt;
		return arg:upper()&lt;br /&gt;
	else&lt;br /&gt;
		return arg:sub(1,1):upper() .. arg:sub(2)&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
--&lt;br /&gt;
-- uppercases first letter, lowercases everything else&lt;br /&gt;
--&lt;br /&gt;
&lt;br /&gt;
function p.ucflc(arg)&lt;br /&gt;
	if not arg or arg:len() == 0 then&lt;br /&gt;
		return nil&lt;br /&gt;
	elseif arg:len() == 1 then&lt;br /&gt;
		return arg:upper()&lt;br /&gt;
	else&lt;br /&gt;
		return arg:sub(1,1):upper() .. arg:sub(2):lower()&lt;br /&gt;
	end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return p&lt;/div&gt;</summary>
		<author><name>Starfox9507</name></author>
	</entry>
</feed>