MCPcopy Create free account
hub / github.com/SecureAI-Tools/SecureAI-Tools / toCitationMap

Function toCitationMap

apps/web/lib/fe/components/chat.tsx:527–541  ·  view source on GitHub ↗
(
  citations: CitationResponse[] | undefined,
)

Source from the content-addressed store, hash-verified

525};
526
527const toCitationMap = (
528 citations: CitationResponse[] | undefined,
529): Map<string, CitationResponse[]> => {
530 const map = new Map<string, CitationResponse[]>();
531 citations?.forEach((c) => {
532 const list = map.get(c.chatMessageId);
533 if (list) {
534 list.push(c);
535 } else {
536 map.set(c.chatMessageId, [c]);
537 }
538 });
539
540 return map;
541};

Callers 1

ChatFunction · 0.85

Calls 1

getMethod · 0.65

Tested by

no test coverage detected