Skip to content

Commit 0d88527

Browse files
authoredJan 8, 2024
docs: update readme with URL support (#146)
v6.0.0 introduced URL support, this PR updates the readme to document that change.
1 parent e2a3a91 commit 0d88527

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed
 

‎README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,14 @@ serialize({
4747
fn : function echo(arg) { return arg; },
4848
re : /([^\s]+)/g,
4949
big : BigInt(10),
50+
url : new URL('https://example.com/'),
5051
});
5152
```
5253

5354
The above will produce the following string output:
5455

5556
```js
56-
'{"str":"string","num":0,"obj":{"foo":"foo"},"arr":[1,2,3],"bool":true,"nil":null,"undef":undefined,"inf":Infinity,"date":new Date("2016-04-28T22:02:17.000Z"),"map":new Map([["hello","world"]]),"set":new Set([123,456]),"fn":function echo(arg) { return arg; },"re":new RegExp("([^\\\\s]+)", "g"),"big":BigInt("10")}'
57+
'{"str":"string","num":0,"obj":{"foo":"foo"},"arr":[1,2,3],"bool":true,"nil":null,"undef":undefined,"inf":Infinity,"date":new Date("2016-04-28T22:02:17.000Z"),"map":new Map([["hello","world"]]),"set":new Set([123,456]),"fn":function echo(arg) { return arg; },"re":new RegExp("([^\\\\s]+)", "g"),"big":BigInt("10"),"url":new URL("https://example.com/")}'
5758
```
5859

5960
Note: to produce a beautified string, you can pass an optional second argument to `serialize()` to define the number of spaces to be used for the indentation.

0 commit comments

Comments
 (0)
Please sign in to comment.