MCPcopy Index your code
hub / github.com/coder/coder / getFileText

Function getFileText

site/src/utils/filetree.ts:79–85  ·  view source on GitHub ↗
(path: string, fileTree: FileTree)

Source from the content-addressed store, hash-verified

77};
78
79export const getFileText = (path: string, fileTree: FileTree) => {
80 const content = getFileContent(path, fileTree);
81 if (typeof content !== "string") {
82 throw new Error("File is not a text file");
83 }
84 return content;
85};
86
87export const isFolder = (path: string, fileTree: FileTree) => {
88 const content = getFileContent(path, fileTree);

Callers 1

TemplateVersionEditorFunction · 0.90

Calls 1

getFileContentFunction · 0.85

Tested by

no test coverage detected