Convert Lua values to source-like text and restore them back into Lua values.
- Repository:
opencomputers - System:
openos - Type:
library
OpenComputers/src\main\resources\assets\opencomputers\loot\openos\lib\serialization.lua
local serialization = require("serialization")- Description: Turn numbers, strings, booleans, nil, and tables into Lua-literal-like text, with optional pretty formatting.
- Parameters:
valuepretty
serialization.serialize(nil, nil)- Description: Evaluate serialized text inside a restricted environment and return the reconstructed Lua value.
- Parameters:
data
serialization.unserialize(nil)- Pretty mode is convenient for display, but it may emit output that cannot be round-tripped back through
unserialize.