mirror of
https://github.com/oven-sh/bun
synced 2026-02-13 12:29:07 +00:00
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:
@@ -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 { }
|
||||
|
||||
@@ -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());
|
||||
|
||||
Reference in New Issue
Block a user