Module:User:Kai/sandbox: Difference between revisions

From The Deadlock Wiki
Jump to navigation Jump to search
Inspect bucket methods and global bucket (via update-page on MediaWiki MCP Server)
Blanked the page
Tag: Blanking
 
(12 intermediate revisions by the same user not shown)
Line 1: Line 1:
local p = {}


function p.view(frame)
    local t = {}
    table.insert(t, "mw.ext.bucket methods:")
    for k, v in pairs(mw.ext.bucket) do
        table.insert(t, string.format("mw.ext.bucket[%s] = %s", tostring(k), type(v)))
    end
   
    local inst = mw.ext.bucket('feedback')
    table.insert(t, "\nmw.ext.bucket('feedback') keys:")
    for k, v in pairs(inst) do
        table.insert(t, string.format("inst[%s] = %s", tostring(k), type(v)))
    end
    local meta = getmetatable(inst)
    if meta then
        table.insert(t, "\ninst metatable keys:")
        for k, v in pairs(meta) do
            table.insert(t, string.format("meta[%s] = %s", tostring(k), type(v)))
        end
    end
    if _G.bucket then
        table.insert(t, "\n_G.bucket exists (" .. type(_G.bucket) .. ")")
    end
    return "<pre>" .. table.concat(t, "\n") .. "</pre>"
end
return p

Latest revision as of 21:31, 27 August 2026

Documentation for this module may be created at Module:User:Kai/sandbox/doc