Skip to content

Commit

Permalink
review
Browse files Browse the repository at this point in the history
  • Loading branch information
angorayc committed Jul 24, 2023
1 parent 5b028b0 commit c0ffaea
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,15 @@ const getInitialFilterString = (securityTags: TagReference[] | null | undefined)
if (!securityTags) {
return;
}
const uniqueQueryArray = securityTags?.reduce<string[]>((acc, { name }) => {
const uniqueQuerySet = securityTags?.reduce<Set<string>>((acc, { name }) => {
const nameString = `"${name}"`;
if (name && acc.indexOf(nameString) === -1) {
acc.push(nameString);
if (name && !acc.has(nameString)) {
acc.add(nameString);
}
return acc;
}, []);
}, new Set());

const query = [uniqueQueryArray].join(' or');
const query = [...uniqueQuerySet].join(' or');
return `tag:(${query})`;
};

Expand Down

0 comments on commit c0ffaea

Please sign in to comment.