Skip to content

Commit

Permalink
🧪 multiple passed objects to ii() example
Browse files Browse the repository at this point in the history
  • Loading branch information
astoilkov committed Jan 13, 2025
1 parent 57e2c81 commit ea2e779
Showing 1 changed file with 28 additions and 1 deletion.
29 changes: 28 additions & 1 deletion playground/playground.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ function inspect(value: unknown, options?: ConsoleInspectOptions): unknown {
return value;
}

function inspectMany(...values: unknown[]): unknown {
console.log(...values);
ii(...values);
return values[0];
}

examples.make(() => {
// example 1
consoleTable([
Expand Down Expand Up @@ -404,8 +410,29 @@ examples.make(() => {
ii(new URL("https://example.com"));
});

examples.make(() => {
const objects = [
{
type: "paragraph",
start: 0,
end: 12,
},
{
type: "code",
start: 14,
end: 64,
},
{
type: "paragraph",
start: 16,
end: 156,
},
];
inspectMany(...objects);
});

// ii → unwrap promise
examples.make(() => {
ii(Promise.resolve("hello"));
tt(Promise.resolve(["hello"]));
});
});

0 comments on commit ea2e779

Please sign in to comment.