Skip to content

Commit d34a1ff

Browse files
authored
Update API reference for recho.inspect (#169)
1 parent 6fe7e34 commit d34a1ff

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

app/docs/api-reference.recho.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,28 @@ echo(numbers);
5959
* @returns {string} The formatted string representation of the value.
6060
*/
6161

62+
//➜ "Hello, World!"
63+
const defaultQuotedString = echo("Hello, World!");
64+
65+
//➜ 'Hello, World!'
66+
const singleQuotedString = echo(recho.inspect("Hello, World!", {quote: "single"}));
67+
68+
//➜ "Hello, World!"
69+
const doubleQuotedString = echo(recho.inspect("Hello, World!", {quote: "double"}));
70+
71+
//➜ Hello, World!
72+
const unquotedString = echo(recho.inspect("Hello, World!", {quote: false}));
73+
74+
//➜ {
75+
//➜ a: 1,
76+
//➜ b: 2,
77+
//➜ c: 3
78+
//➜ }
79+
const indentedObject = echo(recho.inspect({a: 1, b: 2, c: 3}, {indent: 2}));
80+
81+
//➜ [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, …
82+
const array1000 = echo(recho.inspect(new Array(1000).fill(0), {limit: Infinity}));
83+
6284
/**
6385
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
6486
* clear()

0 commit comments

Comments
 (0)