aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarshall Lochbaum <mwlochbaum@gmail.com>2021-01-12 14:58:22 -0500
committerMarshall Lochbaum <mwlochbaum@gmail.com>2021-01-12 14:58:22 -0500
commitd8033ff6cd612f8737f3a5fb2905482632488dda (patch)
tree5b26d02872da417e06367db7e6df5d730d4f71d9
parentfd5007d0e5ff97acfddc6d60425f567b8d95dbe5 (diff)
Format printed results in test/js
-rw-r--r--docs/bqn.js5
-rwxr-xr-xtest/js2
2 files changed, 5 insertions, 2 deletions
diff --git a/docs/bqn.js b/docs/bqn.js
index 6612587d..db3085c0 100644
--- a/docs/bqn.js
+++ b/docs/bqn.js
@@ -233,4 +233,7 @@ let fmt1 = run(
)(list([type, decompose, glyph, fmtnum]));
let fmt = x => fmt1(x).map(c=>c===0?" ":c).join("");
-if(typeof module!=='undefined'){module.exports=bqn;}
+if (typeof module!=='undefined') {
+ bqn.fmt=fmt; bqn.compile=compile; bqn.run=run;
+ module.exports=bqn;
+}
diff --git a/test/js b/test/js
index 3f1bcced..b3431fa5 100755
--- a/test/js
+++ b/test/js
@@ -26,5 +26,5 @@ if (onfiles || args.length==0) {
: "All "+test.length+" passed!"
);
} else {
- console.log(args.map(bqn));
+ args.map(a=>console.log(bqn.fmt(bqn(a))));
}