« 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/find.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/util/find.js')
-rw-r--r--src/util/find.js19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/util/find.js b/src/util/find.js
index 460a4fa..71026fa 100644
--- a/src/util/find.js
+++ b/src/util/find.js
@@ -1,18 +1,19 @@
 /** @format */
 
-import {color, logError, logWarn} from './cli.js';
+import {color, logWarn} from './cli.js';
 
 import {inspect} from 'util';
 
 function warnOrThrow(mode, message) {
-  switch (mode) {
-    case 'error':
-      throw new Error(message);
-    case 'warn':
-      logWarn(message);
-    default:
-      return null;
+  if (mode === 'error') {
+    throw new Error(message);
   }
+
+  if (mode === 'warn') {
+    logWarn(message);
+  }
+
+  return null;
 }
 
 function findHelper(keys, findFns = {}) {
@@ -80,7 +81,7 @@ function findHelper(keys, findFns = {}) {
   };
 }
 
-function matchDirectory(ref, data, mode) {
+function matchDirectory(ref, data) {
   return data.find(({directory}) => directory === ref);
 }