MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / parseSchtasksQuery

Function parseSchtasksQuery

packages/server/src/svc/schtasks-xml.ts:77–95  ·  view source on GitHub ↗
(output: string)

Source from the content-addressed store, hash-verified

75
76
77export function parseSchtasksQuery(output: string): Record<string, string> | undefined {
78
79 const lines = output.split(/\r?\n/).filter((line) => line.trim().length > 0);
80 if (lines.length < 2) return undefined;
81
82 const header = parseCsvRow(lines[0] ?? '');
83 const firstRow = parseCsvRow(lines[1] ?? '');
84 if (header.length === 0 || firstRow.length === 0) return undefined;
85
86 const out: Record<string, string> = {};
87 for (let i = 0; i < header.length; i += 1) {
88 const key = header[i] ?? '';
89 const value = firstRow[i] ?? '';
90 if (key.length > 0) {
91 out[key] = value;
92 }
93 }
94 return out;
95}
96
97
98function parseCsvRow(line: string): string[] {

Callers 2

schtasks.test.tsFile · 0.90
statusFunction · 0.90

Calls 1

parseCsvRowFunction · 0.85

Tested by

no test coverage detected