« get me outta code hell

divide things.js into modular files (hilariously) - 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>2022-11-28 23:25:05 -0400
committer(quasar) nebula <qznebula@protonmail.com>2022-11-28 23:25:05 -0400
commit690a7b53a72ac71f9f76260fa50c634566c4e984 (patch)
tree841653cf0e474c6edd437ec36884f2130b5b7b43 /src/util/sugar.js
parentae9dba60c4bbb327b402c500cc042922a954de74 (diff)
divide things.js into modular files (hilariously)
Diffstat (limited to 'src/util/sugar.js')
-rw-r--r--src/util/sugar.js6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/util/sugar.js b/src/util/sugar.js
index 808a7e1c..e8fdf932 100644
--- a/src/util/sugar.js
+++ b/src/util/sugar.js
@@ -405,7 +405,7 @@ export function _withAggregate(mode, aggregateOpts, fn) {
 }
 
 export function showAggregate(topError, {
-  pathToFile = (p) => p,
+  pathToFileURL = f => f,
   showTraces = true,
 } = {}) {
   const recursive = (error, {level}) => {
@@ -429,9 +429,7 @@ export function showAggregate(topError, {
         ? '- ' +
           stackLine
             .trim()
-            .replace(/file:\/\/(.*\.js)/, (match, pathname) =>
-              pathToFile(pathname)
-            )
+            .replace(/file:\/\/.*\.js/, (match) => pathToFileURL(match))
         : '(no stack trace)';
       header += ` ${color.dim(tracePart)}`;
     }