« get me outta code hell

data: import Thing.common utilities directly - hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/util/sugar.js
diff options
context:
space:
mode:
author(quasar) nebula <qznebula@protonmail.com>2023-09-07 12:38:34 -0300
committer(quasar) nebula <qznebula@protonmail.com>2023-09-07 12:38:34 -0300
commiteb00f2993a1aaaba171ad6c918656552f80bb748 (patch)
tree5e61200ed707e02b76c337cb9107aa5f1eaa8898 /src/util/sugar.js
parent6889c764caef5542ba9ad8362acf6e8b7b879ea9 (diff)
data: import Thing.common utilities directly
Also rename 'color' (from #cli) to 'colors'.
Diffstat (limited to 'src/util/sugar.js')
-rw-r--r--src/util/sugar.js10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/util/sugar.js b/src/util/sugar.js
index 1ba3f3a..ebb7d61 100644
--- a/src/util/sugar.js
+++ b/src/util/sugar.js
@@ -6,7 +6,7 @@
 // It will likely only do exactly what I want it to, and only in the cases I
 // decided were relevant enough to 8other handling.
 
-import {color} from './cli.js';
+import {colors} from './cli.js';
 
 // Apparently JavaScript doesn't come with a function to split an array into
 // chunks! Weird. Anyway, this is an awesome place to use a generator, even
@@ -566,10 +566,10 @@ export function showAggregate(topError, {
             .trim()
             .replace(/file:\/\/.*\.js/, (match) => pathToFileURL(match))
         : '(no stack trace)';
-      header += ` ${color.dim(tracePart)}`;
+      header += ` ${colors.dim(tracePart)}`;
     }
-    const bar = level % 2 === 0 ? '\u2502' : color.dim('\u254e');
-    const head = level % 2 === 0 ? '\u257f' : color.dim('\u257f');
+    const bar = level % 2 === 0 ? '\u2502' : colors.dim('\u254e');
+    const head = level % 2 === 0 ? '\u257f' : colors.dim('\u257f');
 
     if (error instanceof AggregateError) {
       return (
@@ -605,7 +605,7 @@ export function decorateErrorWithIndex(fn) {
     try {
       return fn(x, index, array);
     } catch (error) {
-      error.message = `(${color.yellow(`#${index + 1}`)}) ${error.message}`;
+      error.message = `(${colors.yellow(`#${index + 1}`)}) ${error.message}`;
       throw error;
     }
   };