MCPcopy
hub / github.com/codeaashu/claude-code / mapValuesDeep

Function mapValuesDeep

src/services/vcr.ts:221–236  ·  view source on GitHub ↗
(
  obj: {
    [x: string]: unknown
  },
  f: (val: unknown, key: string, obj: Record<string, unknown>) => unknown,
)

Source from the content-addressed store, hash-verified

219}
220
221function mapValuesDeep(
222 obj: {
223 [x: string]: unknown
224 },
225 f: (val: unknown, key: string, obj: Record<string, unknown>) => unknown,
226): Record<string, unknown> {
227 return mapValues(obj, (val, key) => {
228 if (Array.isArray(val)) {
229 return val.map(_ => mapValuesDeep(_, f))
230 }
231 if (isPlainObject(val)) {
232 return mapValuesDeep(val as Record<string, unknown>, f)
233 }
234 return f(val, key, obj)
235 })
236}
237
238function mapAssistantMessage(
239 message: AssistantMessage,

Callers 2

mapMessagesFunction · 0.85
mapAssistantMessageFunction · 0.85

Calls 1

fFunction · 0.50

Tested by

no test coverage detected