MCPcopy Create free account
hub / github.com/1Panel-dev/MaxKB / relatedObject

Function relatedObject

ui/src/utils/array.ts:38–41  ·  view source on GitHub ↗
(list: any, val: any, attr: string)

Source from the content-addressed store, hash-verified

36 从指定数组中过滤出对应的对象
37*/
38export function relatedObject(list: any, val: any, attr: string) {
39 const filterData: any = list.find((item: any) => item[attr] === val)
40 return filterData || null
41}
42
43// 排序
44export function arraySort(list: Array<any>, property: any, desc?: boolean) {

Callers 1

getTriggerCycleLabelFunction · 0.90

Calls 1

findMethod · 0.45

Tested by

no test coverage detected