mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-21 10:47:04 +02:00
fix: shallow testing
This commit is contained in:
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",
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in new issue
Block a user