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);