From eeb2aeee00df76f078c9eb6a7a04a6cf1d411f9e Mon Sep 17 00:00:00 2001 From: WayJam So Date: Tue, 15 Dec 2020 00:53:55 +0800 Subject: [PATCH] fix: invalid expand path --- src/utils/VisibleNodesGenerator.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/utils/VisibleNodesGenerator.ts b/src/utils/VisibleNodesGenerator.ts index c869319..25638f2 100644 --- a/src/utils/VisibleNodesGenerator.ts +++ b/src/utils/VisibleNodesGenerator.ts @@ -290,7 +290,11 @@ class FlattenLayer extends CompressLayer { [rootNode], async node => { const overflowChar = node.path[path.length + 1] - const match = path.startsWith(node.path) && (overflowChar === '/' || !overflowChar) + const nextChar = path.slice(node.path.length, node.path.length + 1) + const match = + path.startsWith(node.path) && + (overflowChar === '/' || !overflowChar) && + (!node.path || nextChar === '/' || !nextChar) if (node.path) { // rootNode.path === '' if (match) {