MCPcopy Create free account
hub / github.com/Linen-dev/linen.dev / parseResults

Function parseResults

apps/web/ui/SearchBar/index.tsx:8–20  ·  view source on GitHub ↗
(
  data: SerializedSearchMessage[]
)

Source from the content-addressed store, hash-verified

6import type { ApiClient } from '@linen/api-client';
7
8const parseResults = (
9 data: SerializedSearchMessage[]
10): (SerializedSearchMessage & { value: string })[] => {
11 const allIds = new Set();
12 return data
13 .map((r) => ({ ...r, value: r.body }))
14 .filter((r) => {
15 if (!r.threadId) return false;
16 if (allIds.has(r.id)) return false;
17 allIds.add(r.id);
18 return true;
19 });
20};
21
22const SearchBar = ({
23 className,

Callers 1

fetchResultsFunction · 0.85

Calls 3

mapMethod · 0.80
hasMethod · 0.80
addMethod · 0.80

Tested by

no test coverage detected