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

Function parseCsvRow

packages/server/src/svc/schtasks-xml.ts:98–136  ·  view source on GitHub ↗
(line: string)

Source from the content-addressed store, hash-verified

96
97
98function parseCsvRow(line: string): string[] {
99 const cells: string[] = [];
100 let current = '';
101 let inQuotes = false;
102 let i = 0;
103 while (i < line.length) {
104 const ch = line[i];
105 if (inQuotes) {
106 if (ch === '"') {
107 if (line[i + 1] === '"') {
108 current += '"';
109 i += 2;
110 continue;
111 }
112 inQuotes = false;
113 i += 1;
114 continue;
115 }
116 current += ch;
117 i += 1;
118 } else {
119 if (ch === '"') {
120 inQuotes = true;
121 i += 1;
122 continue;
123 }
124 if (ch === ',') {
125 cells.push(current);
126 current = '';
127 i += 1;
128 continue;
129 }
130 current += ch;
131 i += 1;
132 }
133 }
134 cells.push(current);
135 return cells;
136}

Callers 1

parseSchtasksQueryFunction · 0.85

Calls 1

pushMethod · 0.45

Tested by

no test coverage detected