|
2 | 2 |
|
3 | 3 | **Seriall** is a simple serialization library.
|
4 | 4 |
|
5 |
| -```mermaid |
6 |
| -flowchart LR |
7 |
| - val((Value)) |
8 |
| - pures{{Pures}} |
9 |
| - str[String] |
10 |
| -
|
11 |
| - val <--> pures <--> str; |
12 |
| -``` |
13 |
| - |
14 |
| -| Value | Pures | String (JSON Format) | |
15 |
| -| ------------------- | -------------------------------------------------------- | ------------------------------------------------------------------ | |
16 |
| -| `12138` | `[12138]` | `[12138]` | |
17 |
| -| `true` | `[true]` | `[true]` | |
18 |
| -| `16n` | `[{T:3,V:"16"}]` | `[{"T":3,"V":"16"}]` | |
19 |
| -| `[80, 'http']` | `[[1,2],80,"http"]` | `[[1,2],80,"http"]` | |
20 |
| -| `Math` | `[{T:7,K:"Math"}]` | `[{"T":7,"K":"Math"}]` | |
21 |
| -| `new Set()` | `[{T:8,N:"Set",V:1},[]]` | `[{"T":8,"N":"Set","V":1},[]]` | |
22 |
| -| `{ name: 'Steve' }` | `[{T:6,C:1,P:[["name",2,{}]]},{T:7,K:"Object"},"Steve"]` | `[{"T":6,"C":1,"P":[["name",2,{}]]},{"T":7,"K":"Object"},"Steve"]` | |
23 |
| - |
24 |
| -- **Value** - It can be any value, but for some special type of values, you may need to specify some extra information to make it work. |
25 |
| -- **Pures** - It can be directly converted to JSON string, then converted back and remain unchanged. |
26 |
| -- **String** - A string in JSON format. |
| 5 | +| Value | Serialized | |
| 6 | +| ------------------- | -------------------------------------------------------- | |
| 7 | +| `12138` | `[12138]` | |
| 8 | +| `true` | `[true]` | |
| 9 | +| `16n` | `[{T:3,V:"16"}]` | |
| 10 | +| `[80, 'http']` | `[[1,2],80,"http"]` | |
| 11 | +| `Math` | `[{T:7,K:"Math"}]` | |
| 12 | +| `new Set()` | `[{T:8,N:"Set",V:1},[]]` | |
| 13 | +| `{ name: 'Steve' }` | `[{T:6,C:1,P:[["name",2,{}]]},{T:7,K:"Object"},"Steve"]` | |
27 | 14 |
|
28 | 15 | ## Features
|
29 | 16 |
|
|
0 commit comments