opencode/packages/codemode-rust/conformance/cases/std-console-table.js
kommander 98653cbfff feat(codemode): add console.table
Ported from the reference's formatConsoleTable: one tab-separated line per
row under an (index) header, object rows spread into their keys (or the
chosen columns), primitives under Value, strings unquoted and other cells
in the console's format. Data holding a function or other opaque reference
logs [opaque reference]. console.dir() with no argument now logs undefined,
as in the reference.
2026-11-18 18:56:10 +01:00

15 lines
583 B
JavaScript

console.table([{ a: 1, b: "x" }, { b: 2, c: [1, 2] }, 5, "s", [1, 2]])
console.table({ r1: { x: 1 }, r2: { y: { z: 1 } }, r3: null })
console.table([{ a: 1, b: 2 }, { a: 3 }], ["b", "a", "zz"])
console.table(5)
console.table("str")
console.table()
console.table(undefined)
console.table([{ f: () => 1 }])
console.table(new Map([[1, 2]]))
console.table([{ 2: "two", 1: "one", b: "b" }, { 10: "ten" }])
console.table([new Date(0), /x/g, null, undefined, true])
console.table({ a: { toString() { return 1 } } }, [{ toString() { return "a" } }])
console.dir()
console.dir(1, 2)
return 1