(body: readonly string[], expression: string)
| 49 | * well-formed JSON body rather than an empty string. |
| 50 | */ |
| 51 | export const writeJsonResult = (body: readonly string[], expression: string): string => |
| 52 | [ |
| 53 | "await (async () => {", |
| 54 | ...body.map((line) => ` ${line}`), |
| 55 | ` const result = ${expression};`, |
| 56 | " nodeRepl.write(JSON.stringify(result ?? null));", |
| 57 | "})();", |
| 58 | ].join("\n"); |
no outgoing calls
no test coverage detected