MCPcopy Create free account
hub / github.com/EvoMap/evolver / finishLine

Function finishLine

src/proxy/mailbox/store.js:157–182  ·  view source on GitHub ↗
(hasNewline = false)

Source from the content-addressed store, hash-verified

155 };
156
157 const finishLine = (hasNewline = false) => {
158 const totalLineBytes = lineBytes + (hasNewline ? 1 : 0);
159 if (dropping) {
160 stats.overlong += 1;
161 resetLine();
162 return;
163 }
164 if (totalLineBytes > maxLineBytes) {
165 stats.overlong += 1;
166 resetLine();
167 return;
168 }
169 if (lineBytes === 0) {
170 resetLine();
171 return;
172 }
173 const trimmed = Buffer.concat(parts, lineBytes).toString('utf8').trim();
174 resetLine();
175 if (!trimmed) return;
176 try {
177 onRow(JSON.parse(trimmed));
178 stats.parsed += 1;
179 } catch {
180 stats.corrupt += 1;
181 }
182 };
183
184 try {
185 fd = fs.openSync(filePath, 'r');

Callers 1

forEachJsonLineFunction · 0.85

Calls 2

resetLineFunction · 0.85
parseMethod · 0.80

Tested by

no test coverage detected