mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 19:49:50 +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({
|
await uploader.add({
|
||||||
content: GameDefinitions.encode(gameDefinitions).finish(),
|
content: GameDefinitions.encode(gameDefinitions).finish(),
|
||||||
path: "definitions/game.pb",
|
path: "definitions/game.pb",
|
||||||
|
|||||||
@@ -49,20 +49,18 @@ export abstract class AbstractVFS {
|
|||||||
|
|
||||||
dir(path: string) {
|
dir(path: string) {
|
||||||
const parentSegments = path.split("/").length;
|
const parentSegments = path.split("/").length;
|
||||||
const children: string[] = [];
|
const children = new Set<string>();
|
||||||
|
|
||||||
for (const child of this.paths()) {
|
for (const child of this.paths()) {
|
||||||
const childSegments = child.split("/");
|
if (!child.startsWith(path) || child === path) continue;
|
||||||
|
|
||||||
if (
|
const childSegments = child.split("/");
|
||||||
child.startsWith(path) &&
|
const nextSegment = childSegments[parentSegments];
|
||||||
parentSegments + 1 === childSegments.length
|
|
||||||
) {
|
children.add(nextSegment);
|
||||||
children.push(childSegments.at(-1)!);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return children;
|
return Array.from(children);
|
||||||
}
|
}
|
||||||
|
|
||||||
async text(path: string) {
|
async text(path: string) {
|
||||||
|
|||||||
Reference in new issue
Block a user