Jump to content

Module:table/isSubsetList

From Wiktionary, the free dictionary

local table_list_to_set_module = "Module:table/listToSet"  local pairs = pairs  local function list_to_set(...) list_to_set = require(table_list_to_set_module) return list_to_set(...) end  --[==[ Returns true if the first list, taken as a set, is a subset of the second list, taken as a set.]==] return function(t1, t2) t2 = list_to_set(t2) for _, v in pairs(t1) do if t2[v] == nil then return false end end return true end