Module system.serialization.lua¶
Lua table encoder/decoder
Index¶
API Reference¶
-
system.serialization.lua.encode(
val:any,
opts?: {minified:boolean, allow_functions:boolean}
): (result:string)¶ Serializes an arbitrary Lua object into a serialized Lua string.
- Parameters:
val (
any) – The value to encodeopts? ({minified:
boolean, allow_functions:boolean}) – Any options to specify while encoding
- Returns:
result (
string) – The serialized Lua representation of the object
-
system.serialization.lua.decode(str:
string, opts?: {allow_functions:boolean}): (result:any)¶ Parses a serialized Lua string and returns a Lua value represented by the string.
- Parameters:
str (
string) – The serialized Lua string to decodeopts? ({allow_functions:
boolean}) – Any options to specify while decoding
- Returns:
result (
any) – The Lua value from the serialized Lua
-
system.serialization.lua.save(
val:any,
path:string,
opts?: {minified:boolean, allow_functions:boolean}
)¶ Saves a Lua value to a serialized Lua file.
- Parameters:
val (
any) – The value to savepath (
string) – The path to the file to saveopts? ({minified:
boolean, allow_functions:boolean}) – Any options to specify while encoding
-
system.serialization.lua.load(path:
string, opts?: {allow_functions:boolean}): (result:any)¶ Loads a serialized Lua file into a Lua value.
- Parameters:
path (
string) – The path to the file to loadopts? ({allow_functions:
boolean}) – Any options to specify while decoding
- Returns:
result (
any) – The loaded value