fix: invalid expand path

This commit is contained in:
WayJam So 2020-12-15 00:53:55 +08:00
parent 80b241be1b
commit eeb2aeee00
No known key found for this signature in database
GPG key ID: B3D925C858D9E7FB

View file

@ -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) {