Skip to content

Commit

Permalink
Merge pull request #60 from addyosmani/XhmikosR-patch-1
Browse files Browse the repository at this point in the history
index.js: use a ternary
  • Loading branch information
bezoerb committed Sep 19, 2023
2 parents 5210b92 + 2f92281 commit 65645a1
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
});
Expand Down

0 comments on commit 65645a1

Please sign in to comment.