Module:Category handler/shared

-- This module contains shared functions used by [[Module:Category handler]]-- and its submodules.local p = {}function p.matchesBlacklist(page, blacklist)for i, pattern in ipairs(blacklist) dolocal match = mw.ustring.match(page, pattern)if match thenreturn trueendendreturn falseendfunction p.getParamMappings(useLoadData)local dataPage = 'Module:Namespace detect/data'if useLoadData thenreturn mw.loadData(dataPage).mappingselsereturn require(dataPage).mappingsendendfunction p.getNamespaceParameters(titleObj, mappings)-- We don't use title.nsText for the namespace name because it adds-- underscores.local mappingsKeyif titleObj.isTalkPage thenmappingsKey = 'talk'elsemappingsKey = mw.site.namespaces[titleObj.namespace].nameendmappingsKey = mw.ustring.lower(mappingsKey)return mappings[mappingsKey] or {}endreturn p