feat(console): add printer for mapiterator (#6778)

* feat(console): add printer for mapiterator

MapIterator was not supported in printing, libraries like discordjs make big use of maps and
so i think supporting them would be a good idea.

* fix: snake case var

* fix: add tests for log and add setiterator printer
This commit is contained in:
Liz
2023-10-30 09:29:25 +01:00
committed by GitHub
parent 08fdbb3c7d
commit e5ccce1e89
3 changed files with 139 additions and 25 deletions

View File

@@ -75,3 +75,37 @@ String 123 should be 2nd word, 456 == 456 and percent s %s == What okay
}
}
}
SetIterator {
1,
"123",
{
a: [],
str: "123123132",
nr: 3453
},
}
SetIterator {
1,
"123",
{
a: [],
str: "123123132",
nr: 3453
},
}
SetIterator { } SetIterator { }
MapIterator {
"key",
"key_2",
}
MapIterator {
{
a: [],
str: "123123132",
nr: 3453
},
{
b: "test"
},
}
MapIterator { } MapIterator { }

View File

@@ -76,3 +76,14 @@ console.dir({ 1: { 2: { 3: 3 } } }, { depth: 0, colors: false }, "Some ignored a
console.dir({ 1: { 2: { 3: 3 } } }, { depth: -1, colors: false }, "Some ignored arg");
console.dir({ 1: { 2: { 3: 3 } } }, { depth: 1.2, colors: false }, "Some ignored arg");
console.dir({ 1: { 2: { 3: 3 } } }, { depth: Infinity, colors: false }, "Some ignored arg");
const set = new Set([1, "123", { a: [], str: "123123132", nr: 3453 }]);
console.log(set.keys());
console.log(set.values());
console.log(new Set().keys(), new Set().values());
const m = new Map([
["key", { a: [], str: "123123132", nr: 3453 }],
["key_2", { b: "test" }],
]);
console.log(m.keys());
console.log(m.values());
console.log(new Map().keys(), new Map().values());