summary refs log tree commit diff
diff options
context:
space:
mode:
authorMathMan05 <mathmanrm@gmail.com>2025-11-25 23:28:56 -0600
committerMathMan05 <mathmanrm@gmail.com>2025-11-25 23:28:56 -0600
commitb3de3ddd9cc4e99081628d71482f7d6fffbf2601 (patch)
treec4d8338840c32605509c9827d4fca8014c480cf1
parentremove except (it's probally faster this way too) (diff)
downloadserver-ts-b3de3ddd9cc4e99081628d71482f7d6fffbf2601.tar.xz
remove unused intersect
-rw-r--r--src/util/util/extensions/Array.test.ts10
-rw-r--r--src/util/util/extensions/Array.ts5
2 files changed, 0 insertions, 15 deletions
diff --git a/src/util/util/extensions/Array.test.ts b/src/util/util/extensions/Array.test.ts

index faabfdea..432e9a59 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 11d93920..eec76a0f 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<K>(key: (elem: T) => K): T[]; - intersect(other: T[]): T[]; } } @@ -117,7 +116,3 @@ if (!Array.prototype.distinctBy) Array.prototype.distinctBy = function <T, K>(this: T[], key: (elem: T) => K) { return arrayDistinctBy.call(this, key as (elem: unknown) => unknown); }; -if (!Array.prototype.intersect) - Array.prototype.intersect = function <T>(this: T[], other: T[]) { - return arrayIntersect.call(this, other); - };