Discover Packages
github.com/vadv/gopher-lua-libs
inspect
package
Version:
v0.5.0
Opens a new window with list of versions in this module.
Published: Sep 14, 2023
License: BSD-3-Clause
Opens a new window with license information.
Imports: 2
Opens a new window with list of imports.
Imported by: 12
Opens a new window with list of known importers.
README
README
¶
inspect
Usage
local inspect = require("inspect")
local table = {a={b=2}}
local result = inspect(table, {newline="", indent=""})
if not(result == "{a = {b = 2}}") then error("inspect") end
Expand ▾
Collapse ▴
Documentation
¶
inspect(obj)
state := lua.NewState()
Preload(state)
source := `
local inspect = require("inspect")
local table = {a={b=2}}
print(inspect(table, {newline="", indent=""}))
`
if err := state.DoString(source); err != nil {
log.Fatal(err.Error())
}
Output:
{a = {b = 2}}
Loader is the module loader function.
Preload adds inspect to the given Lua state's package.preload table. After it
has been preloaded, it can be loaded using require:
local inspect = require("inspect")
Source Files
¶
Click to show internal directories.
Click to hide internal directories.