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

Function textOf

graph-ui/tools/style-gate.mjs:122–139  ·  view source on GitHub ↗

Ein Text, oder null, wenn die Datei binaer ist oder nicht gelesen werden kann.

(relativePath)

Source from the content-addressed store, hash-verified

120
121/** Ein Text, oder null, wenn die Datei binaer ist oder nicht gelesen werden kann. */
122async function textOf(relativePath) {
123 const absolute = join(ROOT, relativePath);
124 if (!existsSync(absolute)) {
125 return null;
126 }
127 try {
128 if (statSync(absolute).isDirectory()) {
129 return null;
130 }
131 const buffer = await readFile(absolute);
132 if (buffer.includes(0)) {
133 return null;
134 }
135 return buffer.toString('utf8');
136 } catch {
137 return null;
138 }
139}
140
141/**
142 * Ob ein Strich in dieser Datei als woertliches Zitat durchgeht.

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected