MCPcopy Create free account
hub / github.com/AmazingAng/PolyWorld / dedupByTime

Function dedupByTime

src/components/ChartPanel.tsx:111–115  ·  view source on GitHub ↗
(data: T[])

Source from the content-addressed store, hash-verified

109}
110
111function dedupByTime<T extends { time: number }>(data: T[]): T[] {
112 const map = new Map<number, T>();
113 for (const d of data) map.set(d.time, d);
114 return Array.from(map.values()).sort((a, b) => a.time - b.time);
115}
116
117interface CrosshairData {
118 open: number;

Callers 1

ChartPanelInnerFunction · 0.85

Calls 1

setMethod · 0.45

Tested by

no test coverage detected