Module:TableTools: Difference between revisions
Content deleted Content added
m Changed protection level for "Module:TableTools": High-risk Lua module: bumping protection level due to high usage, plus the stability of the module. See https://en.wikipedia.org/w/index.php?title=Wikipedia:Requests_for_page_protection&oldid=983044034#Module:TableTools ([Edit=Require administrator access] (indefinite) [Move=Require administrator access] (indefinite)) |
Caleb Cooper (talk | contribs) No edit summary |
||
| (3 intermediate revisions by 2 users not shown) | |||
Line 30:
--]]
function p.isPositiveInteger(v)
return false
end
Line 44 ⟶ 48:
--]]
function p.isNan(v)
return true
else
return false
end
end
Line 129 ⟶ 137:
local function cleanPattern(s)
-- Cleans a pattern so that the magic characters ()%.[]*+-?^$ are interpreted literally.
return s
end
Line 413 ⟶ 422:
--[[
--
-- 1 such that t[n + 1] is nil. It is similar to the operator #, but may return▼
▲-- It is similar to the operator #, but may return
-- a different value when there are gaps in the array portion of the table.
-- Intended to be used on data loaded with mw.loadData. For other tables, use #.
Line 422 ⟶ 430:
-- frame.args.
--]]
▲function p.length(t, prefix)
while t[i] ~= nil do
end
return i - 1
▲ local key
▲ else
▲ key = i
▲ end
▲ return t[key] ~= nil
end
function p.inArray(arr, valueToFind)
checkType("inArray", 1, arr, "table")
| |||