Skip to content

Commit 68424d1

Browse files
committed
🎨 Use guard clause in helper getElements
1 parent 99e9893 commit 68424d1

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/script/lib/helper.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,7 @@ export function getElements(selector: string, root: Document | HTMLElement | Sha
8686
const selectors = selector.split('>>>');
8787

8888
// No shadowRoot in selector: return native querySelectorAll
89-
if (selectors.length == 1) {
90-
return root.querySelectorAll(selector);
91-
}
89+
if (selectors.length == 1) return root.querySelectorAll(selector);
9290

9391
// shadowRoot in selector: return querySelectorAll through shadowRoot(s)
9492
while (selectors.length) {

0 commit comments

Comments
 (0)