« get me outta code hell

lots of fixes from eslint - 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:
author(quasar) nebula <qznebula@protonmail.com>2022-06-26 20:57:06 -0300
committer(quasar) nebula <qznebula@protonmail.com>2022-06-26 20:57:06 -0300
commit08b700bb14e5e12c1dff283e2eef729816a97f15 (patch)
tree0494ff87d7ede3e0d7f561063c08c74011204486 /src/util/find.js
parentc6e9aba1f6d1239b3d884c2749d1f0d15c7662a1 (diff)
lots of fixes from eslint
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);
 }