MCPcopy Create free account
hub / github.com/experdot/pointer / collect

Function collect

src/renderer/src/features/export/plugins/formats/txtFormat.ts:164–183  ·  view source on GitHub ↗
(id: string)

Source from the content-addressed store, hash-verified

162 const visited = new Set<string>()
163
164 function collect(id: string): void {
165 if (visited.has(id)) return
166 visited.add(id)
167
168 const msg = messageMap.get(id)
169 if (!msg) return
170
171 result.push(msg)
172
173 if (endMessageId && id === endMessageId) return
174
175 for (const m of messages) {
176 if (m.parentMessageId === id) {
177 if (allTopicStartIds.has(m.id) && m.id !== startMessageId) {
178 continue
179 }
180 collect(m.id)
181 }
182 }
183 }
184
185 collect(startMessageId)
186 return result

Callers 1

getDirectTopicMessagesFunction · 0.70

Calls 2

hasMethod · 0.80
getMethod · 0.65

Tested by

no test coverage detected