3
3
[ ![ Coverage Status] ( https://coveralls.io/repos/github/codenirvana/teleport-javascript/badge.svg?branch=master )] ( https://coveralls.io/github/codenirvana/teleport-javascript?branch=master ) [ ![ Build Status] ( https://travis-ci.org/codenirvana/teleport-javascript.svg?branch=master )] ( https://travis-ci.org/codenirvana/teleport-javascript ) [ ![ License: ISC] ( https://img.shields.io/badge/License-ISC-yellow.svg )] ( https://opensource.org/licenses/ISC ) [ ![ JavaScript Style Guide] ( https://img.shields.io/badge/code_style-standard-brightgreen.svg )] ( https://standardjs.com )
4
4
5
5
6
- A super light and fast JavaScript object (de)serialization that includes date, bigint, regex , etc.
6
+ A super light and fast JavaScript object (de)serialization that includes Date, BigInt, RegExp , etc.
7
7
8
8
### Installation
9
9
``` console
@@ -19,12 +19,13 @@ const obj = {
19
19
undefined : undefined ,
20
20
regex: / a-z/ gi ,
21
21
set: new Set ([- Infinity , NaN , Infinity ]),
22
- bigint: 900719925474099123n
22
+ bigint: 900719925474099123n ,
23
+ symbol: Symbol (' key' )
23
24
};
24
25
obj .circular = obj;
25
26
26
27
const stringified = stringify (obj);
27
- // '[{"key":"1","undefined":"_0","regex":"_1","set":"_2","bigint":"_3","circular":"0"},"value",["u","R; /a-z/gi","S; [[\\"_0\\",\\"_1\\",\\"_2\\"],[\\"n; -Infinity\\",\\"n;NaN \\",\\"n;Infinity \\"]]","b;900719925474099123 "]]'
28
+ // '[{"key":"1","undefined":"_0","regex":"_1","set":"_2","bigint":"_3","symbol":"_4"," circular":"0"},"value",["u","R/a-z/gi","S[[\\"_0\\",\\"_1\\",\\"_2\\"],[\\"n-Infinity\\",\\"nNaN \\",\\"nInfinity \\"]]","b900719925474099123","skey "]]'
28
29
29
30
const parsed = parse (stringified);
30
31
// {
@@ -33,6 +34,7 @@ const parsed = parse(stringified);
33
34
// regex: /a-z/gi,
34
35
// set: Set { -Infinity, NaN, Infinity },
35
36
// bigint: 900719925474099123n,
37
+ // symbol: Symbol(key),
36
38
// circular: [Circular]
37
39
// }
38
40
```
@@ -42,6 +44,7 @@ const parsed = parse(stringified);
42
44
* Number _ (including NaN, Infinity, -Infinity)_
43
45
* BigInt
44
46
* Boolean
47
+ * Symbol
45
48
* Null
46
49
* Undefined
47
50
* Array
@@ -54,7 +57,6 @@ const parsed = parse(stringified);
54
57
- Uint32Array
55
58
- Float32Array
56
59
- Float64Array
57
- * Symbol
58
60
* Object _ (including circular reference)_
59
61
- Date
60
62
- Buffer
0 commit comments