diff --git a/pkg.go b/pkg.go index c002e76..1d7f67d 100644 --- a/pkg.go +++ b/pkg.go @@ -38,6 +38,12 @@ func (l *LUA) GetStructFromLUA(ltable gopherLua.LValue, strct any) (err error) { return } +func (l *LUA) GetJSONromLUA(ltable gopherLua.LValue) (j []byte) { + j, _ = luaJSON.Encode(ltable) + return +} + + func (l *LUA) Run(script string) (err error) { return l.state.DoString(script) }