Skip to content

Commit 4f1b725

Browse files
committed
Updated README.md
1 parent f78eb97 commit 4f1b725

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

README.md

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,18 @@ const stringify = fastJson({
3434
age: {
3535
description: 'Age in years',
3636
type: 'integer'
37+
},
38+
reg: {
39+
type: 'string'
3740
}
3841
}
3942
})
4043

4144
console.log(stringify({
4245
firstName: 'Matteo',
4346
lastName: 'Collina',
44-
age: 32
47+
age: 32,
48+
reg: /"([^"]|\\")*"/
4549
}))
4650
```
4751

@@ -61,8 +65,15 @@ Supported types:
6165
* `'boolean'`
6266
* `'null'`
6367

64-
And nested ones, too.
65-
`Date` instances are serialized with `toISOString()`.
68+
And nested ones, too.
69+
70+
*Specific use cases:*
71+
72+
| Instance | Serialized as |
73+
| -----------|---------------------------------------------|
74+
| `Date` | `string` <small>via `toISOString()`</small> |
75+
| `RegExp` | `string` |
76+
6677

6778
## Acknowledgements
6879

0 commit comments

Comments
 (0)