m (Ihaveahax moved page Module:FBI QR codes to Module:FBI QR code without leaving a redirect: match template name) |
(test...) |
||
(27 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
local p = {} | local p = {} | ||
-- from [[Module:Infobox]] | -- from [[Module:Infobox]] | ||
Line 23: | Line 5: | ||
-- for the specified prefix. For example, if the prefix was 'data', and | -- for the specified prefix. For example, if the prefix was 'data', and | ||
-- 'data1', 'data2', and 'data5' exist, it would return {1, 2, 5}. | -- 'data1', 'data2', and 'data5' exist, it would return {1, 2, 5}. | ||
local function getArgNums(prefix | local function getArgNums(prefix) | ||
local nums = {} | local nums = {} | ||
for k, v in pairs(args) do | for k, v in pairs(args) do | ||
Line 33: | Line 15: | ||
end | end | ||
function | local function argsToObjects( args ) | ||
local | local objects = {} | ||
for k, v in args do | |||
for k, v in | |||
end | end | ||
end | end | ||
function p. | function p.main( frame ) | ||
end | end | ||
return p | return p |
Revision as of 22:08, 3 July 2022
Documentation for this module may be created at Module:FBI QR code/doc
local p = {}
-- from [[Module:Infobox]]
-- Returns a table containing the numbers of the arguments that exist
-- for the specified prefix. For example, if the prefix was 'data', and
-- 'data1', 'data2', and 'data5' exist, it would return {1, 2, 5}.
local function getArgNums(prefix)
local nums = {}
for k, v in pairs(args) do
local num = tostring(k):match('^' .. prefix .. '([1-9]%d*)$')
if num then table.insert(nums, tonumber(num)) end
end
table.sort(nums)
return nums
end
local function argsToObjects( args )
local objects = {}
for k, v in args do
end
end
function p.main( frame )
end
return p