( path: string, content: FileTree | string, fileTree: FileTree, )
| 40 | }; |
| 41 | |
| 42 | export 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 | |
| 51 | export const existsFile = (path: string, fileTree: FileTree) => { |
| 52 | return has(fileTree, path.split("/")); |
no test coverage detected