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

Function updateFile

site/src/utils/filetree.ts:42–49  ·  view source on GitHub ↗
(
	path: string,
	content: FileTree | string,
	fileTree: FileTree,
)

Source from the content-addressed store, hash-verified

40};
41
42export const updateFile = (
43 path: string,
44 content: FileTree | string,
45 fileTree: FileTree,
46): FileTree => {
47 const updatedFileTree = structuredClone(fileTree);
48 return set(updatedFileTree, path.split("/"), content);
49};
50
51export const existsFile = (path: string, fileTree: FileTree) => {
52 return has(fileTree, path.split("/"));

Callers 1

TemplateVersionEditorFunction · 0.90

Calls 1

setFunction · 0.85

Tested by

no test coverage detected