aboutsummaryrefslogtreecommitdiff
path: root/src/commands/dev/javascript.ts
diff options
context:
space:
mode:
authorIRONM00N <64110067+IRONM00N@users.noreply.github.com>2022-06-02 18:10:17 -0400
committerIRONM00N <64110067+IRONM00N@users.noreply.github.com>2022-06-02 18:10:17 -0400
commit5f4f28903b2f3428e54ed74417fc06e8eeb58ebf (patch)
tree6c31807fa3de0bb142ae2bfc7496ee96663a81eb /src/commands/dev/javascript.ts
parent34b55d206c5048b4abacf68c663261f494c888a2 (diff)
downloadtanzanite-5f4f28903b2f3428e54ed74417fc06e8eeb58ebf.tar.gz
tanzanite-5f4f28903b2f3428e54ed74417fc06e8eeb58ebf.tar.bz2
tanzanite-5f4f28903b2f3428e54ed74417fc06e8eeb58ebf.zip
feat(errorHandler): ansi colors
Diffstat (limited to 'src/commands/dev/javascript.ts')
-rw-r--r--src/commands/dev/javascript.ts7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/commands/dev/javascript.ts b/src/commands/dev/javascript.ts
index d25b790..373f149 100644
--- a/src/commands/dev/javascript.ts
+++ b/src/commands/dev/javascript.ts
@@ -60,10 +60,11 @@ export default class JavascriptCommand extends BushCommand {
const rawOutput = /^(9\s*?\+\s*?10)|(10\s*?\+\s*?9)$/.test(code)
? '21'
: new VM({ eval: true, wasm: true, timeout: 1_000, fixAsync: true }).run(`${code}`);
- const output = await util.inspectCleanRedactCodeblock(rawOutput, 'js', {
+ const output = await util.inspectCleanRedactCodeblock(rawOutput, 'ansi', {
depth: args.sel_depth ?? 0,
getters: true,
- inspectStrings: true
+ inspectStrings: true,
+ colors: true
});
embed.setTitle(`${util.emojis.successFull} Successfully Evaluated Expression`).setColor(util.colors.success);
@@ -75,7 +76,7 @@ export default class JavascriptCommand extends BushCommand {
embed.setTitle(`${util.emojis.errorFull} Unable to Evaluate Expression`).setColor(util.colors.error);
embed.addFields([
{ name: '📥 Input', value: input },
- { name: '📤 Error', value: await util.inspectCleanRedactCodeblock(e, 'js') }
+ { name: '📤 Error', value: await util.inspectCleanRedactCodeblock(e, 'ansi', { colors: true }) }
]);
}