From c7dd1a0c7090999df3ea9c26022ce47b153f7183 Mon Sep 17 00:00:00 2001 From: Jera Date: Wed, 1 Sep 2021 01:59:10 -0400 Subject: [PATCH] Code Cleanup cleaned up the if condition --- deemix/utils/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/deemix/utils/index.js b/deemix/utils/index.js index f765e82..388536f 100644 --- a/deemix/utils/index.js +++ b/deemix/utils/index.js @@ -26,7 +26,7 @@ function changeCase(txt, type){ case 'start': txt = txt.split(" ") for (let i = 0; i < txt.length; i++) { - if (txt[i].startsWith("(") || txt[i].startsWith("[") || txt[i].startsWith("{")) { + if (bracket = ['(', '{', '['].some(bracket => txt[i].startsWith(bracket))) { txt[i] = txt[i][0] + txt[i][1].toUpperCase() + txt[i].substr(2).toLowerCase() } else { txt[i] = txt[i][0].toUpperCase() + txt[i].substr(1).toLowerCase()