MCPcopy Create free account
hub / github.com/microsoft/AI-Engineering-Coach / detailToString

Function detailToString

src/core/runtime-debug.ts:32–44  ·  view source on GitHub ↗
(detail: unknown)

Source from the content-addressed store, hash-verified

30}
31
32function detailToString(detail: unknown): string {
33 if (detail === undefined || detail === null) return '';
34 if (detail instanceof Error) return detail.stack || detail.message;
35 if (typeof detail === 'string') return detail;
36 if (typeof detail === 'number' || typeof detail === 'boolean' || typeof detail === 'bigint') {
37 return `${detail}`;
38 }
39 try {
40 return JSON.stringify(detail);
41 } catch {
42 return Object.prototype.toString.call(detail);
43 }
44}
45
46function runtimeMemorySummary(): string {
47 const mem = process.memoryUsage();

Callers 1

runtimeDebugFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected