From 1226ce89a76659953f72a844f71ebe7a98656fb5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tr=C3=A8sAbhi?= <43380238+tresabhi@users.noreply.github.com> Date: Wed, 10 Dec 2025 17:46:58 -0600 Subject: [PATCH] fix: shallow testing --- packages/scripts/src/buildAssets/definitions.ts | 4 ---- packages/scripts/src/core/vfs/abstract.ts | 16 +++++++--------- 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/packages/scripts/src/buildAssets/definitions.ts b/packages/scripts/src/buildAssets/definitions.ts index 9708173f5..94608ef77 100644 --- a/packages/scripts/src/buildAssets/definitions.ts +++ b/packages/scripts/src/buildAssets/definitions.ts @@ -1778,10 +1778,6 @@ export async function definitions() { }; }); - console.log(gameDefinitions); - - console.log(GameDefinitions.encode(gameDefinitions).finish().length); - await uploader.add({ content: GameDefinitions.encode(gameDefinitions).finish(), path: "definitions/game.pb", diff --git a/packages/scripts/src/core/vfs/abstract.ts b/packages/scripts/src/core/vfs/abstract.ts index b6027d9d4..122c33f15 100644 --- a/packages/scripts/src/core/vfs/abstract.ts +++ b/packages/scripts/src/core/vfs/abstract.ts @@ -49,20 +49,18 @@ export abstract class AbstractVFS { dir(path: string) { const parentSegments = path.split("/").length; - const children: string[] = []; + const children = new Set(); for (const child of this.paths()) { - const childSegments = child.split("/"); + if (!child.startsWith(path) || child === path) continue; - if ( - child.startsWith(path) && - parentSegments + 1 === childSegments.length - ) { - children.push(childSegments.at(-1)!); - } + const childSegments = child.split("/"); + const nextSegment = childSegments[parentSegments]; + + children.add(nextSegment); } - return children; + return Array.from(children); } async text(path: string) {