mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-09 23:38:04 -04:00
Created API/Serialization (markdown)
parent
754f513afb
commit
db83bc6007
8
API-Serialization.md
Normal file
8
API-Serialization.md
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
This module provides simple value serialization.
|
||||||
|
|
||||||
|
- `serialization.serialize(value: any except functions[, pretty:boolean]): string`
|
||||||
|
Generates a string from an object that can be parsed again using `serialization.unserialize`. The generated output is Lua code. Supports basic types (nil, boolean, number, string) and tables without cycles (will error out when cycles are detected, unless in `pretty` print mode). Properly handles NaN values and infinity.
|
||||||
|
The `pretty` mode can be used to generate output for display to the user, this output will in most circumstances not be readable with `serialization.unserialize`.
|
||||||
|
This function can be useful for sending messages via a network card.
|
||||||
|
- `serialization.unserialize(value: string): any`
|
||||||
|
Restores an object previously saved with `serialization.serialize`.
|
Loading…
x
Reference in New Issue
Block a user