Skip to content

Commit a8537af

Browse files
committed
update README
1 parent ffc179a commit a8537af

File tree

2 files changed

+11
-25
lines changed

2 files changed

+11
-25
lines changed

README.md

+9-22
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,15 @@
22

33
**Seriall** is a simple serialization library.
44

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"]` |
2714

2815
## Features
2916

test/tutorial.test.ts

+2-3
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import { assert } from '@std/assert/assert';
44
import * as seriall from '@/mod.ts';
55

66
Deno.test(function examples() {
7-
console.log(`| Value | Pures | String (JSON Format) |`);
8-
console.log(`|-|-|-|`);
7+
console.log(`| Value | Serialized |`);
8+
console.log(`|-|-|`);
99
Object.entries({
1010
'true': true,
1111
'12138': 12138,
@@ -18,7 +18,6 @@ Deno.test(function examples() {
1818
[
1919
key,
2020
seriall.stringify(value).replace(/"(\w)":/g, '$1:'),
21-
seriall.stringify(value),
2221
].map((s) => '`' + s + '`')
2322
).map((s) => console.log('|', s.join(' | '), '|'));
2423
});

0 commit comments

Comments
 (0)