summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2025-07-20 09:51:11 -0300
committerEuAndreh <eu@euandre.org>2025-07-20 09:51:11 -0300
commit4a2d42910aa499e397a72a528d54f7f19f2fc8e7 (patch)
tree315bb0e4353b2bf0beec4cb0391de8d5ca887ce2
parentMakefile: Update installation directory to be compatible with node (diff)
downloadsjs-4a2d42910aa499e397a72a528d54f7f19f2fc8e7.tar.gz
sjs-4a2d42910aa499e397a72a528d54f7f19f2fc8e7.tar.xz
src/sjs.mjs (mappings): Add `tap()`
-rw-r--r--src/sjs.mjs16
1 files changed, 16 insertions, 0 deletions
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 => {