MCPcopy Create free account
hub / github.com/cameri/nostream / enrichEventMetadata

Function enrichEventMetadata

src/services/event-import-service.ts:29–46  ·  view source on GitHub ↗
(event: Event)

Source from the content-addressed store, hash-verified

27}
28
29const enrichEventMetadata = (event: Event): Event => {
30 let enriched: EventWithImportMetadata = event
31
32 const expiration = getEventExpiration(event)
33 if (expiration) {
34 enriched = { ...enriched, [EventExpirationTimeMetadataKey]: expiration }
35 }
36
37 if (isParameterizedReplaceableEvent(event)) {
38 const [, deduplication] = event.tags.find((tag) => tag.length >= 2 && tag[0] === EventTags.Deduplication) ?? [
39 null,
40 '',
41 ]
42 enriched = { ...enriched, [EventDeduplicationMetadataKey]: deduplication ? [deduplication] : [''] }
43 }
44
45 return enriched
46}
47
48const DEFAULT_BATCH_SIZE = 1000
49

Callers 1

Calls 2

getEventExpirationFunction · 0.90

Tested by

no test coverage detected