Skip to content

Commit 8307c87

Browse files
committed
using for loop instead of forEach in element classlists
pick #64 and close #68
1 parent dbdf58a commit 8307c87

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/snapshot.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,11 +183,13 @@ export function _isBlockedElement(
183183
return true;
184184
}
185185
} else {
186-
element.classList.forEach((className) => {
186+
// tslint:disable-next-line: prefer-for-of
187+
for (let eIndex = 0; eIndex < element.classList.length; eIndex++) {
188+
const className = element.classList[eIndex];
187189
if (blockClass.test(className)) {
188190
return true;
189191
}
190-
});
192+
}
191193
}
192194
if (blockSelector) {
193195
return element.matches(blockSelector);

0 commit comments

Comments
 (0)