MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / readText

Function readText

src/ui-server/api/when.ts:172–183  ·  view source on GitHub ↗
(abs: string)

Source from the content-addressed store, hash-verified

170 };
171 /** A file's text, once, for the directive and declaration reads; null past the size cap or unreadable. */
172 const readText = (abs: string): string | null => {
173 let text = texts.get(abs);
174 if (text === undefined) {
175 try {
176 text = fs.statSync(abs).size <= MAX_DIRECTIVE_FILE ? fs.readFileSync(abs, 'utf8') : null;
177 } catch {
178 text = null;
179 }
180 texts.set(abs, text);
181 }
182 return text;
183 };
184 // Named rather than a method, because `createWhenReader` hands `when` out
185 // detached: it must not depend on `this`.
186 const guards = async (

Callers 2

directiveFunction · 0.70
swiftExtensionFunction · 0.70

Calls 2

getMethod · 0.65
setMethod · 0.45

Tested by

no test coverage detected