fix: explicitly match the file (#1065)

This commit is contained in:
anonion 2023-08-23 03:33:01 -06:00 committed by GitHub
parent d2de208450
commit 7ea8ac3ded
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -47,7 +47,7 @@ export function genFileTree(files) {
.reduce((parentPath, nodeName) => {
const nextPath = parentPath === '' ? nodeName : parentPath + '/' + nodeName
if (file.name.endsWith(nodeName)) {
if (file.name.replace('\\', '/').split('/').pop() === nodeName) {
/** @type {TreeFile} */
const newFile = {
type: 'file',