···2525export function clear() {
2626 console.clear();
2727}
2828+2929+export function group(label) {
3030+ console.group(label);
3131+}
3232+3333+export function group_collapsed(label) {
3434+ console.groupCollapsed(label);
3535+}
3636+3737+export function group_end() {
3838+ console.groupEnd();
3939+}
+18
src/plinth/javascript/console.gleam
···3232/// and will have no effect (and no error).
3333@external(javascript, "../../console_ffi.mjs", "clear")
3434pub fn clear() -> Nil
3535+3636+/// Creates a new inline group in the Web console log,
3737+/// causing any subsequent console messages to be indented by an additional level,
3838+/// until `console.group_end` is called.
3939+@external(javascript, "../../console_ffi.mjs", "group")
4040+pub fn group(label: String) -> Nil
4141+4242+/// reates a new inline group in the console. Unlike `console.group`, however,
4343+/// the new group is created collapsed. The user will need to use the disclosure
4444+/// button next to it to expand it, revealing the entries created in the group.
4545+///
4646+/// Call `console.group_end` to back out to the parent group.
4747+@external(javascript, "../../console_ffi.mjs", "group_collapsed")
4848+pub fn group_collapsed(label: String) -> Nil
4949+5050+/// Exits the current inline group in the console
5151+@external(javascript, "../../console_ffi.mjs", "group_end")
5252+pub fn group_end() -> Nil
+8
test/javascript/node/console_test.gleam
···2727pub fn assert_fail_test() {
2828 console.assert_(False, "You should see this!")
2929}
3030+3131+pub fn group_test() {
3232+ console.group("test label")
3333+ console.log("Inside the group")
3434+ console.log("Also inside the group")
3535+ console.group_end()
3636+ console.log("Outside the group")
3737+}