From 1f8d5a3023dc0ec84ebd1b18f361bd5e8a7a2a9f Mon Sep 17 00:00:00 2001 From: MathMan05 Date: Fri, 26 Jun 2026 22:26:09 -0500 Subject: [PATCH] new polyfill --- src/webpage/utils/pollyfills.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/webpage/utils/pollyfills.ts b/src/webpage/utils/pollyfills.ts index 38434ce..2ad5082 100644 --- a/src/webpage/utils/pollyfills.ts +++ b/src/webpage/utils/pollyfills.ts @@ -48,6 +48,18 @@ function defineItter(itter: typeof Iterator) { i++; } }; + itter.prototype.find ??= function find( + callbackfn: (element: U, index: number) => boolean, + ): U | undefined { + let i = 0; + for (const thing of this) { + if (callbackfn(thing, i)) { + return thing; + } + i++; + } + return undefined; + }; } if ("Iterator" in globalThis) { defineItter(globalThis.Iterator);