pull/1155/head
lyswhut 2023-01-11 16:47:57 +08:00
parent db38db9256
commit 1c802ad5f5
4 changed files with 4 additions and 4 deletions

View File

@ -176,7 +176,7 @@ export const similar = (a: string, b: string) => {
* @param arr
* @param data
*/
export const sortInsert = (arr: Array<{ num: number, data: any }>, data: { num: number, data: any }) => {
export const sortInsert = <T>(arr: Array<{ num: number, data: T }>, data: { num: number, data: T }) => {
let key = data.num
let left = 0
let right = arr.length - 1

View File

@ -35,7 +35,7 @@ declare namespace LX {
interface UserListInfo {
id: string
name: string
source?: LX.Source
source?: LX.OnlineSource
sourceListId?: string
position: number
locationUpdateTime: number | null

View File

@ -147,7 +147,7 @@ export const listDataOverwrite = ({ defaultList, loveList, userList, tempList }:
export const userListCreate = ({ name, id, source, sourceListId, position, locationUpdateTime }: {
name: string
id: string
source?: LX.Source
source?: LX.OnlineSource
sourceListId?: string
position: number
locationUpdateTime: number | null

View File

@ -195,7 +195,7 @@ export const searchListMusic = (list: LX.Music.MusicInfo[], text: string) => {
if (rxp.test(str)) result.push(mInfo)
}
const sortedList: any[] = []
const sortedList: Array<{ num: number, data: LX.Music.MusicInfo }> = []
for (const mInfo of result) {
sortInsert(sortedList, {