Skip to content

Commit

Permalink
Merge branch 'main' into feat/ton-branding-update
Browse files Browse the repository at this point in the history
  • Loading branch information
rahulyadav-57 committed Oct 8, 2024
2 parents fc7c760 + f55c9d6 commit 66e7e93
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
27 changes: 27 additions & 0 deletions src/lib/polyfills.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/* eslint-disable @typescript-eslint/no-unnecessary-condition, @typescript-eslint/no-explicit-any */

// Extend the Set prototype to include isSubsetOf
interface Set<T> {
isSubsetOf(otherSet: Set<T>): boolean;
}

if (!(Set.prototype as any).isSubsetOf) {
(Set.prototype as any).isSubsetOf = function <T>(
this: Set<T>,
otherSet: Set<T>,
): boolean {
// @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;
}
}
return true;
};
}

/* eslint-enable */

// Add an empty export statement to ensure it's treated as a module
export {};
1 change: 1 addition & 0 deletions src/pages/_app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import type { AppProps } from 'next/app';
import Head from 'next/head';
import { useEffect } from 'react';
import { RecoilRoot } from 'recoil';
import '../lib/polyfills';

mixpanel.init(AppConfig.analytics.MIXPANEL_TOKEN, {
debug: false,
Expand Down

0 comments on commit 66e7e93

Please sign in to comment.