From b3de3ddd9cc4e99081628d71482f7d6fffbf2601 Mon Sep 17 00:00:00 2001 From: MathMan05 Date: Tue, 25 Nov 2025 23:28:56 -0600 Subject: [PATCH] remove unused intersect --- src/util/util/extensions/Array.test.ts | 10 ---------- src/util/util/extensions/Array.ts | 5 ----- 2 files changed, 15 deletions(-) diff --git a/src/util/util/extensions/Array.test.ts b/src/util/util/extensions/Array.test.ts index faabfdeab..432e9a590 100644 --- a/src/util/util/extensions/Array.test.ts +++ b/src/util/util/extensions/Array.test.ts @@ -64,14 +64,4 @@ describe("Array extensions", () => { [], ); }); - - it("intersect", () => { - const arr1 = [1, 2, 3, 4]; - const arr2 = [3, 4, 5, 6]; - assert.deepEqual(arr1.intersect(arr2), [3, 4]); - assert.deepEqual(arr1.intersect([]), []); - // eslint-disable-next-line @typescript-eslint/ban-ts-comment - // @ts-expect-error - assert.deepEqual([].intersect(arr2), []); - }); }); diff --git a/src/util/util/extensions/Array.ts b/src/util/util/extensions/Array.ts index 11d939207..eec76a0fb 100644 --- a/src/util/util/extensions/Array.ts +++ b/src/util/util/extensions/Array.ts @@ -25,7 +25,6 @@ declare global { remove(item: T): void; distinct(): T[]; distinctBy(key: (elem: T) => K): T[]; - intersect(other: T[]): T[]; } } @@ -117,7 +116,3 @@ if (!Array.prototype.distinctBy) Array.prototype.distinctBy = function (this: T[], key: (elem: T) => K) { return arrayDistinctBy.call(this, key as (elem: unknown) => unknown); }; -if (!Array.prototype.intersect) - Array.prototype.intersect = function (this: T[], other: T[]) { - return arrayIntersect.call(this, other); - };