Skip to content

Commit

Permalink
Review feedback 2
Browse files Browse the repository at this point in the history
  • Loading branch information
tunetheweb committed Sep 6, 2024
1 parent c0481e7 commit 60b4a0c
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/lib/getSelector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,7 @@ export const getSelector = (node: Node | null | undefined, maxLen?: number) => {
const el: Element = node as Element;
const part = el.id
? '#' + el.id
: getName(el) +
(el.classList?.length
? '.' + Array.from(el.classList).sort().join('.')
: '');
: getName(el) + Array.from(el.classList).sort().join('.');
if (sel.length + part.length > (maxLen || 100) - 1) return sel || part;
sel = sel ? part + '>' + sel : part;
if (el.id) break;
Expand Down

0 comments on commit 60b4a0c

Please sign in to comment.