« get me outta code hell

hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/util
diff options
context:
space:
mode:
Diffstat (limited to 'src/util')
-rw-r--r--src/util/replacer.js12
-rw-r--r--src/util/sugar.js6
2 files changed, 5 insertions, 13 deletions
diff --git a/src/util/replacer.js b/src/util/replacer.js
index 70c17e5f..ea5a674d 100644
--- a/src/util/replacer.js
+++ b/src/util/replacer.js
@@ -1,7 +1,5 @@
 /** @format */
 
-import fixWS from 'fix-whitespace';
-
 import {logError, logWarn} from './cli.js';
 import {escapeRegex} from './sugar.js';
 
@@ -331,11 +329,11 @@ export function parseInput(input) {
 
     const cursor = i - lineStart;
 
-    throw new SyntaxError(fixWS`
-      Parse error (at pos ${i}): ${message}
-      ${line}
-      ${'-'.repeat(cursor) + '^'}
-    `);
+    throw new SyntaxError([
+      `Parse error (at pos ${i}): ${message}`,
+      line,
+      '-'.repeat(cursor) + '^',
+    ].join('\n'));
   }
 }
 
diff --git a/src/util/sugar.js b/src/util/sugar.js
index 8b59deef..c836d0ce 100644
--- a/src/util/sugar.js
+++ b/src/util/sugar.js
@@ -47,12 +47,6 @@ export function accumulateSum(array, fn = x => x) {
 export const mapInPlace = (array, fn) =>
   array.splice(0, array.length, ...array.map(fn));
 
-export const filterEmptyLines = (string) =>
-  string
-    .split('\n')
-    .filter((line) => line.trim())
-    .join('\n');
-
 export const unique = (arr) => Array.from(new Set(arr));
 
 export const compareArrays = (arr1, arr2, {checkOrder = true} = {}) =>