fix: shallow testing

This commit is contained in:
TrèsAbhi committed 2025-12-10 17:46:58 -06:00
1 parent dcc8207fb6
commit 1226ce89a7
2 files changed
+7 -13

No files matched your search

@@ -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",
+7 -9
View File
@@ -49,20 +49,18 @@ export abstract class AbstractVFS {
dir(path: string) {
const parentSegments = path.split("/").length;
const children: string[] = [];
const children = new Set<string>();
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) {