MCPcopy Create free account
hub / github.com/codeaashu/claude-code / stripProtoFields

Function stripProtoFields

src/services/analytics/index.ts:45–58  ·  view source on GitHub ↗
(
  metadata: Record<string, V>,
)

Source from the content-addressed store, hash-verified

43 * Returns the input unchanged (same reference) when no _PROTO_ keys present.
44 */
45export function stripProtoFields<V>(
46 metadata: Record<string, V>,
47): Record<string, V> {
48 let result: Record<string, V> | undefined
49 for (const key in metadata) {
50 if (key.startsWith('_PROTO_')) {
51 if (result === undefined) {
52 result = { ...metadata }
53 }
54 delete result[key]
55 }
56 }
57 return result ?? metadata
58}
59
60// Internal type for logEvent metadata - different from the enriched EventMetadata in metadata.ts
61type LogEventMetadata = { [key: string]: boolean | number | undefined }

Callers 2

logEventImplFunction · 0.85
transformLogsToEventsMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected