Skip to content

Commit

Permalink
Use spread
Browse files Browse the repository at this point in the history
  • Loading branch information
XhmikosR committed Aug 20, 2023
1 parent c83911d commit b6c6d6f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,11 @@ function oust(src, type, raw) {
}
}

const chosenTypes = typeArray.map(type => ({...types[type], type}));
const selector = chosenTypes.map(type => type.selector).join(', ');
const $ = cheerio.load(src);
const chosenTypes = typeArray.map(type => ({...types[type], type}));
const $selector = $(chosenTypes.map(type => type.selector).join(', '));

return Array.prototype.map.call($(selector), element => {
return [...$selector].map(element => {
const $el = $(element);
const {type, method, attribute} = chosenTypes.find(type => $el.is(type.selector));
let value = '';
Expand Down

0 comments on commit b6c6d6f

Please sign in to comment.