MCPcopy
hub / github.com/coder/mux / extractDevcontainerLogText

Function extractDevcontainerLogText

src/node/runtime/devcontainerCli.ts:47–66  ·  view source on GitHub ↗
(value: Record<string, unknown>)

Source from the content-addressed store, hash-verified

45}
46
47function extractDevcontainerLogText(value: Record<string, unknown>): string | null {
48 const text = typeof value.text === "string" ? value.text : undefined;
49 if (text) {
50 const level = typeof value.level === "number" ? value.level : 0;
51 const channel = typeof value.channel === "string" ? value.channel : "";
52 const type = typeof value.type === "string" ? value.type : "";
53 const isError = channel === "error" || type === "error";
54 if (level >= 2 || isError) {
55 return text;
56 }
57 return null;
58 }
59
60 const name = typeof value.name === "string" ? value.name : undefined;
61 if (name) {
62 return name;
63 }
64
65 return null;
66}
67
68function parseJsonLine(line: string): unknown {
69 try {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected