MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / lineContaining

Function lineContaining

graph-ui/tools/record-demo.mjs:237–243  ·  view source on GitHub ↗

* Die Zeile, in der ein Ausdruck steht, aus der Datei gelesen. * * Uebernommen aus tools/smoke-w2b.mjs. Eine feste Zahl waere eine zweite * Wahrheit ueber das Fixture, die beim naechsten Zeilenumbruch still falsch * wird.

(source, needle, where)

Source from the content-addressed store, hash-verified

235 * wird.
236 */
237function lineContaining(source, needle, where) {
238 const index = source.split('\n').findIndex((line) => line.includes(needle));
239 if (index < 0) {
240 throw new Error(`"${needle}" steht nicht in ${where}`);
241 }
242 return index + 1;
243}
244
245async function main() {
246 const totalStarted = Date.now();

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected