From ea2e779ada5d729f3f4863e58676362dddab2845 Mon Sep 17 00:00:00 2001 From: Antonio Stoilkov Date: Mon, 13 Jan 2025 13:58:55 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=AA=20multiple=20passed=20objects=20to?= =?UTF-8?q?=20`ii()`=20example?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- playground/playground.ts | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/playground/playground.ts b/playground/playground.ts index 25affb8..b7d22f0 100644 --- a/playground/playground.ts +++ b/playground/playground.ts @@ -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([ @@ -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"])); -}); \ No newline at end of file +});