MCPcopy Create free account
hub / github.com/experdot/pointer / getMaxOrderAtLevel

Function getMaxOrderAtLevel

src/renderer/src/utils/treeUtils.ts:37–43  ·  view source on GitHub ↗
(
  items: T[],
  parentFolderId?: string
)

Source from the content-addressed store, hash-verified

35}
36
37export function getMaxOrderAtLevel<T extends TreeNode>(
38 items: T[],
39 parentFolderId?: string
40): number {
41 const itemsAtLevel = items.filter((item) => item.parentFolderId === parentFolderId)
42 return itemsAtLevel.reduce((max, item) => Math.max(max, item.order ?? 0), -1)
43}
44
45// ==================== ConfigTree 操作 ====================
46

Callers 2

removeTreeFolderFunction · 0.85
calculateInsertPositionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected