Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nodejs/node.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorRuben Bridgewater <ruben@bridgewater.de>2019-11-02 21:13:51 +0300
committerRuben Bridgewater <ruben@bridgewater.de>2019-12-15 16:58:58 +0300
commitab599898617f222679b200fe78d3eb0e974bfa69 (patch)
treeb4eeb1104c246287cbb81a0175e2dd9790f4fae0 /doc
parenteeae5986fdd77558cee2699afbe83a3a461b61fb (diff)
util: add Set and map size to inspect output
This adds the size of a set and map to the output. This aligns the output with the one from Chromium. PR-URL: https://github.com/nodejs/node/pull/30225 Reviewed-By: Michaƫl Zasso <targos@protonmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
Diffstat (limited to 'doc')
-rw-r--r--doc/api/util.md8
1 files changed, 4 insertions, 4 deletions
diff --git a/doc/api/util.md b/doc/api/util.md
index f4e689a2130..4727cdb88e9 100644
--- a/doc/api/util.md
+++ b/doc/api/util.md
@@ -576,7 +576,7 @@ console.log(util.inspect(o, { compact: true, depth: 5, breakLength: 80 }));
// 'test',
// 'foo' ] ],
// 4 ],
-// b: Map { 'za' => 1, 'zb' => 'test' } }
+// b: Map(2) { 'za' => 1, 'zb' => 'test' } }
// Setting `compact` to false changes the output to be more reader friendly.
console.log(util.inspect(o, { compact: false, depth: 5, breakLength: 80 }));
@@ -597,7 +597,7 @@ console.log(util.inspect(o, { compact: false, depth: 5, breakLength: 80 }));
// ],
// 4
// ],
-// b: Map {
+// b: Map(2) {
// 'za' => 1,
// 'zb' => 'test'
// }
@@ -639,9 +639,9 @@ const o1 = {
c: new Set([2, 3, 1])
};
console.log(inspect(o1, { sorted: true }));
-// { a: '`a` comes before `b`', b: [ 2, 3, 1 ], c: Set { 1, 2, 3 } }
+// { a: '`a` comes before `b`', b: [ 2, 3, 1 ], c: Set(3) { 1, 2, 3 } }
console.log(inspect(o1, { sorted: (a, b) => b.localeCompare(a) }));
-// { c: Set { 3, 2, 1 }, b: [ 2, 3, 1 ], a: '`a` comes before `b`' }
+// { c: Set(3) { 3, 2, 1 }, b: [ 2, 3, 1 ], a: '`a` comes before `b`' }
const o2 = {
c: new Set([2, 1, 3]),