Skip to content

Commit

Permalink
Change negation from - to !
Browse files Browse the repository at this point in the history
  • Loading branch information
shilman committed Mar 26, 2024
1 parent 632d12b commit aedde7f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ describe('combineTags', () => {
['a', 'b', 'b'],
['a', 'b'],
],
[['a', 'b', '-b'], ['a']],
[['a', 'b', '!b'], ['a']],
])('combineTags(%o) -> %o', (tags, expected) => {
expect(combineTags(...tags)).toEqual(expected);
});
Expand Down
4 changes: 2 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ export const parseKind = (kind: string, { rootSeparator, groupSeparator }: Separ
export const combineTags = (...tags: string[]): string[] => {
const set = new Set<string>(tags);
return Array.from(set).reduce((acc, tag) => {
if (tag.startsWith('-')) return acc;
if (!set.has(`-${tag}`)) {
if (tag.startsWith('!')) return acc;
if (!set.has(`!${tag}`)) {
acc.push(tag);
}
return acc;
Expand Down

0 comments on commit aedde7f

Please sign in to comment.