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

Function removeFromArray

src/renderer/src/stores/helpers/pageHelpers.ts:9–10  ·  view source on GitHub ↗
(array: T[], id: string)

Source from the content-addressed store, hash-verified

7
8// 从数组中移除指定ID的项
9export const removeFromArray = <T extends { id: string }>(array: T[], id: string): T[] =>
10 array.filter((item) => item.id !== id)
11
12// 约束侧边栏宽度
13export const constrainSidebarWidth = (width: number): number =>

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected