fix#110 add NodeList forEach polyfill

This commit is contained in:
Yanzhen Yu
2026-04-01 12:00:00 +08:00
parent 530f5baa3a
commit be1d90ab1d
3 changed files with 22 additions and 4 deletions

View File

@@ -163,3 +163,10 @@ export function isTouchEvent(
): event is TouchEvent {
return Boolean((event as TouchEvent).changedTouches);
}
export function polyfill() {
if ('NodeList' in window && !NodeList.prototype.forEach) {
NodeList.prototype.forEach = (Array.prototype
.forEach as unknown) as NodeList['forEach'];
}
}