Lua: Add to/from json convenience functions

Change-Id: Ibf69c8021d676bd6efbbdb5331f1925808fcfe38
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
Marcus Tillmanns
2024-07-24 08:13:09 +02:00
parent d0fe8ac061
commit df583b2cd0
4 changed files with 27 additions and 26 deletions

View File

@@ -288,14 +288,8 @@ void addFetchModule()
callback(error.errorString());
return;
}
if (doc.isObject()) {
callback(LuaEngine::toTable(thisState, doc.object()));
} else if (doc.isArray()) {
callback(LuaEngine::toTable(thisState, doc.array()));
} else {
sol::state_view lua(thisState);
callback(lua.create_table());
}
callback(LuaEngine::toTable(thisState, doc));
});
} else {