diff --git a/src/lib/polyfills.ts b/src/lib/polyfills.ts index d1bfd6a..1beba00 100644 --- a/src/lib/polyfills.ts +++ b/src/lib/polyfills.ts @@ -1,14 +1,18 @@ +/* eslint-disable @typescript-eslint/no-unnecessary-condition, @typescript-eslint/no-explicit-any */ + // Extend the Set prototype to include isSubsetOf interface Set { isSubsetOf(otherSet: Set): boolean; } -if (!Set.prototype.isSubsetOf) { - Set.prototype.isSubsetOf = function ( +if (!(Set.prototype as any).isSubsetOf) { + (Set.prototype as any).isSubsetOf = function ( this: Set, otherSet: Set, ): boolean { - for (let elem of this) { + // @ts-expect-error - TS doesn't know that this is a Set + for (const elem of this) { + // @ts-expect-error - TS doesn't know that otherSet is a Set if (!otherSet.has(elem)) { return false; } @@ -16,3 +20,8 @@ if (!Set.prototype.isSubsetOf) { return true; }; } + +/* eslint-enable */ + +// Add an empty export statement to ensure it's treated as a module +export {};