mirror of
https://github.com/mastodon/mastodon.git
synced 2024-08-20 21:08:15 -07:00
Refactor intersect function in emoji_utils.ts
This commit refactors the intersect function in the emoji_utils.ts file. The `a` and `b` parameters are more explicitly defined as empty arrays, and the indexOf method is replaced with the includes method for better readability and performance. Additionally, the placement of the eslint-disable directive has been adjusted to improve linting results.
This commit is contained in:
parent
33bd4e67e9
commit
78248aea26
1 changed files with 4 additions and 5 deletions
|
@ -209,16 +209,15 @@ function uniq(arr: []) {
|
|||
}, []);
|
||||
}
|
||||
|
||||
/* eslint-disable */
|
||||
|
||||
// @ts-expect-error
|
||||
function intersect(a, b) {
|
||||
function intersect(a: [], b: []) {
|
||||
const uniqA = uniq(a);
|
||||
const uniqB = uniq(b);
|
||||
|
||||
return uniqA.filter((item) => uniqB.indexOf(item) >= 0);
|
||||
return uniqA.filter((item) => uniqB.includes(item));
|
||||
}
|
||||
|
||||
/* eslint-disable */
|
||||
|
||||
// @ts-expect-error
|
||||
function deepMerge(a, b) {
|
||||
let o = {};
|
||||
|
|
Loading…
Reference in a new issue