mirror of
https://github.com/mastodon/mastodon.git
synced 2025-01-10 04:06:27 +01: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
d922b619e3
commit
5de29a1706
@ -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…
x
Reference in New Issue
Block a user