MCPcopy Create free account
hub / github.com/MCSManager/MCSManager / arrayUnique

Function arrayUnique

frontend/src/tools/array.ts:17–21  ·  view source on GitHub ↗
(arr: T[], felidName?: string)

Source from the content-addressed store, hash-verified

15}
16
17export function arrayUnique<T>(arr: T[], felidName?: string): T[] {
18 if (!felidName) return Array.from(new Set(arr));
19 const map = new Map();
20 return arr.filter((v: any) => !map.has(v[felidName]) && map.set(v[felidName], v));
21}

Callers 1

useInstanceTagsFunction · 0.90

Calls 1

setMethod · 0.45

Tested by

no test coverage detected