<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.factorio.com/index.php?action=history&amp;feed=atom&amp;title=Module%3AUtil</id>
	<title>Module:Util - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.factorio.com/index.php?action=history&amp;feed=atom&amp;title=Module%3AUtil"/>
	<link rel="alternate" type="text/html" href="https://wiki.factorio.com/index.php?title=Module:Util&amp;action=history"/>
	<updated>2026-04-22T18:14:25Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.5</generator>
	<entry>
		<id>https://wiki.factorio.com/index.php?title=Module:Util&amp;diff=202524&amp;oldid=prev</id>
		<title>Bilka: Moved util methods to separate module from Module:Infobox</title>
		<link rel="alternate" type="text/html" href="https://wiki.factorio.com/index.php?title=Module:Util&amp;diff=202524&amp;oldid=prev"/>
		<updated>2024-10-25T11:58:05Z</updated>

		<summary type="html">&lt;p&gt;Moved util methods to separate module from Module:Infobox&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;local util = {}&lt;br /&gt;
&lt;br /&gt;
-- @param arg string The argument to check&lt;br /&gt;
-- @param default string The fallback argument&lt;br /&gt;
-- @return boolean @The argument if it&amp;#039;s non-empty, otherwise the default&lt;br /&gt;
function util._arg_or(arg, default)&lt;br /&gt;
  if util._empty_arg(arg) then&lt;br /&gt;
    return default&lt;br /&gt;
  else&lt;br /&gt;
    return arg&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- @param arg string The argument to check&lt;br /&gt;
-- @return boolean @Whether the argument is a string containing only whitespace or empty string or nil&lt;br /&gt;
function util._empty_arg(arg)&lt;br /&gt;
  if type(arg) == &amp;quot;string&amp;quot; then&lt;br /&gt;
    return not string.find(arg, &amp;quot;%S&amp;quot;)&lt;br /&gt;
  else&lt;br /&gt;
    return not arg&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- @param inputstr string A string to be split&lt;br /&gt;
-- @param separator string The separator&lt;br /&gt;
-- @return string[] @The separated strings, without the separator&lt;br /&gt;
function util._split(inputstr, separator)&lt;br /&gt;
  local result = {}&lt;br /&gt;
&lt;br /&gt;
  for str in string.gmatch(inputstr, &amp;quot;([^&amp;quot;..separator..&amp;quot;]+)&amp;quot;) do&lt;br /&gt;
    table.insert(result, mw.text.trim(str))&lt;br /&gt;
  end&lt;br /&gt;
&lt;br /&gt;
  return result&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
-- @param page_title string The title of the page&lt;br /&gt;
-- @return boolean&lt;br /&gt;
function util._page_exists(page_title)&lt;br /&gt;
  if page_title and page_title ~= &amp;quot;&amp;quot; then&lt;br /&gt;
    return mw.title.new(page_title).exists&lt;br /&gt;
  else&lt;br /&gt;
    return false&lt;br /&gt;
  end&lt;br /&gt;
end&lt;br /&gt;
&lt;br /&gt;
return util&lt;/div&gt;</summary>
		<author><name>Bilka</name></author>
	</entry>
</feed>