fix: resolve TypeScript error in exportToJSON method
This commit is contained in:
parent
b60debe013
commit
6e6da5011f
1 changed files with 4 additions and 3 deletions
|
|
@ -1932,9 +1932,10 @@ export class VirtualFileSystem implements IVirtualFileSystem {
|
||||||
// Traverse children
|
// Traverse children
|
||||||
const children = await this.readdir(currentPath)
|
const children = await this.readdir(currentPath)
|
||||||
for (const child of children) {
|
for (const child of children) {
|
||||||
const childPath = currentPath === '/' ? `/${child}` : `${currentPath}/${child}`
|
const childName = typeof child === 'string' ? child : child.name
|
||||||
target[child] = {}
|
const childPath = currentPath === '/' ? `/${childName}` : `${currentPath}/${childName}`
|
||||||
await traverse(childPath, target[child])
|
target[childName] = {}
|
||||||
|
await traverse(childPath, target[childName])
|
||||||
}
|
}
|
||||||
} else if (entity.metadata.vfsType === 'file') {
|
} else if (entity.metadata.vfsType === 'file') {
|
||||||
// For files, include content and metadata
|
// For files, include content and metadata
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue