lua-resty-inspect

Lua 表格的人类可读表示

$ opm get xiangnanscu/lua-resty-inspect

lua-resty-inspect

Lua 表格的人类可读表示。这是对 http://github.com/kikito/inspect.lua 的派生。添加功能

  • 当将 json = true 传递给选项时,输出将是格式化的 json

  • 默认情况下跳过元表渲染

概要

    local inspect = require("resty.inspect")
    local t = setmetatable({a=1,b={c=2}}, {"will be skipped"})
    assert(inspect(t, {json=true})==[[{
      "a" : 1,
      "b" : {
        "c" : 2
      }
    }]])

作者

Nan Xiang(@xiangnanscu)

许可证

mit

版本