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

Function buildDescription

src/utils/slowOperations.ts:75–94  ·  view source on GitHub ↗

* Builds a human-readable description from tagged template arguments. * Only called when an operation was actually slow — never on the fast path. * * args[0] = TemplateStringsArray, args[1..n] = interpolated values

(args: IArguments)

Source from the content-addressed store, hash-verified

73 * args[0] = TemplateStringsArray, args[1..n] = interpolated values
74 */
75function buildDescription(args: IArguments): string {
76 const strings = args[0] as TemplateStringsArray
77 let result = ''
78 for (let i = 0; i < strings.length; i++) {
79 result += strings[i]
80 if (i + 1 < args.length) {
81 const v = args[i + 1]
82 if (Array.isArray(v)) {
83 result += `Array[${(v as unknown[]).length}]`
84 } else if (v !== null && typeof v === 'object') {
85 result += `Object{${Object.keys(v as Record<string, unknown>).length} keys}`
86 } else if (typeof v === 'string') {
87 result += v.length > 80 ? `${v.slice(0, 80)}…` : v
88 } else {
89 result += String(v)
90 }
91 }
92 }
93 return result
94}
95
96class AntSlowLogger {
97 startTime: number

Callers 1

[Symbol.dispose]Method · 0.85

Calls 1

keysMethod · 0.80

Tested by

no test coverage detected