mirror of
https://github.com/spacebarchat/server.git
synced 2026-03-31 18:05:43 +00:00
remove unused intersect
This commit is contained in:
@@ -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), []);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -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);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user