MCPcopy Create free account
hub / github.com/mitmproxy/mitmproxy / buildIndex

Function buildIndex

web/src/js/ducks/flows/_utils.ts:6–8  ·  view source on GitHub ↗
(data: T[])

Source from the content-addressed store, hash-verified

4type Item = { id: string };
5
6export function buildIndex<T extends Item>(data: T[]): Map<string, number> {
7 return new Map(data.map((f, i) => [f.id, i]));
8}
9
10export function buildLookup<T extends Item>(data: T[]): Set<string> {
11 return new Set(data.map((f) => f.id));

Callers 2

flowsReducerFunction · 0.90
_utilsSpec.tsFile · 0.90

Calls 1

mapMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…