From 2f922819a7ad3339af597aeb71c61b3dee531bab Mon Sep 17 00:00:00 2001 From: XhmikosR Date: Tue, 19 Sep 2023 08:34:04 +0300 Subject: [PATCH] index.js: use a ternary --- index.js | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/index.js b/index.js index 8801fc7..ee94ac6 100644 --- a/index.js +++ b/index.js @@ -72,13 +72,7 @@ function oust(src, type, raw) { return [...$selector].map(element => { const $el = $(element); const {type, method, attribute} = chosenTypes.find(type => $el.is(type.selector)); - let value = ''; - - if (method && $el[method]) { - value = $el[method](); - } else if (attribute) { - value = $el.attr(attribute); - } + const value = (method && $el[method]) ? $el[method]() : $el.attr(attribute); return raw ? {$el, type, value} : value; });