fix torrents filter

This commit is contained in:
jxxghp
2023-07-16 08:45:35 +08:00
parent c52d2d3611
commit f8c70622d4
3 changed files with 169 additions and 133 deletions
+11
View File
@@ -32,6 +32,7 @@ export const isToday = (date: Date) => {
)
}
// 计算时间差,返回xx天xx小时xx分钟
export const calculateTimeDifference = (inputTime: string): string => {
if (!inputTime) {
@@ -57,3 +58,13 @@ export const calculateTimeDifference = (inputTime: string): string => {
return `${days}`;
}
}
// 判断一个数组subArray是不是在另一个数组mainArray中
export const isContained = (subArray: any[], mainArray: any[]): boolean => {
return subArray.every(element => mainArray.includes(element));
}
// 判断两个数组是否存在交集
export const isIntersected = (array1: any[], array2: any[]): boolean => {
return array1.some(element => array2.includes(element));
}