MCPcopy Index your code
hub / github.com/microsoft/TypeChat / exprToString

Function exprToString

typescript/src/ts/program.ts:102–106  ·  view source on GitHub ↗
(expr: unknown)

Source from the content-addressed store, hash-verified

100 success(`import { API } from "./schema";\nfunction program(api: API) {\n${functionBody}}`);
101
102 function exprToString(expr: unknown): string {
103 return typeof expr === "object" && expr !== null ?
104 objectToString(expr as Record<string, unknown>) :
105 JSON.stringify(expr);
106 }
107
108 function objectToString(obj: Record<string, unknown>) {
109 if (obj.hasOwnProperty("@ref")) {

Callers 2

objectToStringFunction · 0.85

Calls 1

objectToStringFunction · 0.85

Tested by

no test coverage detected