(item)
| 50 | * @param {string} item url |
| 51 | */ |
| 52 | export function remove(item) { |
| 53 | if (filesTree[item]) { |
| 54 | removeRootTree(item); |
| 55 | emit("remove-file", item); |
| 56 | return; |
| 57 | } |
| 58 | |
| 59 | const tree = getTree(Object.values(filesTree), item); |
| 60 | if (!tree) return; |
| 61 | const { parent } = tree; |
| 62 | const index = parent.children.indexOf(tree); |
| 63 | parent.children.splice(index, 1); |
| 64 | emit("remove-file", tree); |
| 65 | } |
| 66 | |
| 67 | function removeRootTree(url) { |
| 68 | const rootUrl = url.endsWith("/") ? url : `${url}/`; |
nothing calls this directly
no test coverage detected