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

Function tailText

src/webui/observer/jsonl.js:36–45  ·  view source on GitHub ↗
(filePath, maxLines)

Source from the content-addressed store, hash-verified

34}
35
36function tailText(filePath, maxLines) {
37 try {
38 if (!filePath || !fs.existsSync(filePath)) return '';
39 const raw = fs.readFileSync(filePath, 'utf8');
40 const lines = raw.split('\n');
41 return lines.slice(-toPositiveInt(maxLines, 200)).join('\n');
42 } catch {
43 return '';
44 }
45}
46
47function paginate(items, query = {}) {
48 const limit = Math.min(toPositiveInt(query.limit, 50), 200);

Callers 1

getEvolverLogFunction · 0.85

Calls 1

toPositiveIntFunction · 0.85

Tested by

no test coverage detected