From 08b700bb14e5e12c1dff283e2eef729816a97f15 Mon Sep 17 00:00:00 2001 From: "(quasar) nebula" Date: Sun, 26 Jun 2022 20:57:06 -0300 Subject: lots of fixes from eslint --- src/util/find.js | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'src/util/find.js') diff --git a/src/util/find.js b/src/util/find.js index 460a4fad..71026fa2 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); } -- cgit 1.3.0-6-gf8a5