MCPcopy Index your code
hub / github.com/CodebuffAI/codebuff / summarizeAnalyticsValue

Function summarizeAnalyticsValue

common/src/util/analytics-sampling.ts:175–200  ·  view source on GitHub ↗
(
  value: unknown,
)

Source from the content-addressed store, hash-verified

173}
174
175export function summarizeAnalyticsValue(
176 value: unknown,
177): Record<string, unknown> {
178 if (value === null || value === undefined) {
179 return { kind: valueKind(value) }
180 }
181
182 if (typeof value === 'string') {
183 return { kind: 'string', length: value.length }
184 }
185
186 if (Array.isArray(value)) {
187 return { kind: 'array', length: value.length }
188 }
189
190 if (typeof value === 'object') {
191 const keys = Object.keys(value as Record<string, unknown>)
192 return {
193 kind: 'object',
194 keyCount: keys.length,
195 keys: keys.slice(0, 25),
196 }
197 }
198
199 return { kind: valueKind(value) }
200}

Callers 2

sendAnalyticsAndLogFunction · 0.90

Calls 1

valueKindFunction · 0.85

Tested by

no test coverage detected