From 6e6da5011fcd05eb70352d2b8b0fe2f6eed51711 Mon Sep 17 00:00:00 2001 From: David Snelling Date: Thu, 25 Sep 2025 12:15:25 -0700 Subject: [PATCH] fix: resolve TypeScript error in exportToJSON method --- src/vfs/VirtualFileSystem.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/vfs/VirtualFileSystem.ts b/src/vfs/VirtualFileSystem.ts index 6f557b12..cb519731 100644 --- a/src/vfs/VirtualFileSystem.ts +++ b/src/vfs/VirtualFileSystem.ts @@ -1932,9 +1932,10 @@ export class VirtualFileSystem implements IVirtualFileSystem { // Traverse children const children = await this.readdir(currentPath) for (const child of children) { - const childPath = currentPath === '/' ? `/${child}` : `${currentPath}/${child}` - target[child] = {} - await traverse(childPath, target[child]) + const childName = typeof child === 'string' ? child : child.name + const childPath = currentPath === '/' ? `/${childName}` : `${currentPath}/${childName}` + target[childName] = {} + await traverse(childPath, target[childName]) } } else if (entity.metadata.vfsType === 'file') { // For files, include content and metadata