(path: string, content: string | AssetProxy, tree: RepoTree)
| 69 | } |
| 70 | |
| 71 | function writeFile(path: string, content: string | AssetProxy, tree: RepoTree) { |
| 72 | const segments = path.split('/'); |
| 73 | let obj = tree; |
| 74 | while (segments.length > 1) { |
| 75 | const segment = segments.shift() as string; |
| 76 | obj[segment] = obj[segment] || {}; |
| 77 | obj = obj[segment] as RepoTree; |
| 78 | } |
| 79 | (obj[segments.shift() as string] as RepoFile) = { content, path }; |
| 80 | } |
| 81 | |
| 82 | function deleteFile(path: string, tree: RepoTree) { |
| 83 | unset(tree, path.split('/')); |
no outgoing calls
no test coverage detected