From 4a2d42910aa499e397a72a528d54f7f19f2fc8e7 Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Sun, 20 Jul 2025 09:51:11 -0300 Subject: src/sjs.mjs (mappings): Add `tap()` --- src/sjs.mjs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/sjs.mjs b/src/sjs.mjs index e9da7fc..aae85a7 100644 --- a/src/sjs.mjs +++ b/src/sjs.mjs @@ -461,11 +461,27 @@ const mappings = { }; }, }, + tap: { + qjs: () => null, + node: async () => { + const util = await import("node:util"); + return x => { + console.log(util.inspect(x, { + depth: null, + colors: true, + })); + return x; + }; + }, + deno: () => null, + browser: () => null, + }, }; export const JSImpl = getJSImpl(); export const exit = await mappings.exit[ JSImpl]?.(); export const ARGV = await mappings.ARGV[ JSImpl]?.(); +export const tap = await mappings.tap[ JSImpl]?.(); const tconf = await mappings.tconf[JSImpl]?.(); export const runTests = async tests => { -- cgit v1.2.3