feat: merge middle part

This commit is contained in:
wancat committed 2023-08-21 22:22:01 +08:00
1 parent 7405f786a0
commit 4255eb5910
2 files changed
+62 -19

No files matched your search

+5 -3
View File
@@ -63,9 +63,11 @@ export default class FileNode extends File {
})
// If a child exists in this node but not in the provided node, remove it
this.children = this.children.filter((child) =>
fileNode.children.some((c) => c.path === child.path)
)
if (fileNode.children.length > 0) {
this.children = this.children.filter((child) =>
fileNode.children.some((c) => c.path === child.path)
)
}
} else if (this.contains(fileNode)) {
const childNode = this.children.find((child) => child.contains(fileNode))
if (childNode) {