Changes
2 changed files (+27/-3)
-
-
@@ -173,6 +173,24 @@ ],}); }); Deno.test("Should skip empty directories", async () => { const fileSystemReader = new MemoryFsReader([ { path: "a/b/c/d/e.txt", content: "" }, { path: "a/b/f.txt", content: "" }, ]); const builder = new DefaultTreeBuilder({ defaultLanguage: "en", strategies: [fileExtensions([".md"])], }); const tree = await builder.build({ fileSystemReader, contentParser, }); assertEquals(tree.nodes.length, 0); }); Deno.test("ignore() and ignoreDotfiles() should ignore files and directories", async () => { const fileSystemReader = new MemoryFsReader([ { path: "foo/bar/baz.md", content: "" },
-
-
-
@@ -242,13 +242,19 @@ ])), ); const includingEntries = entries.filter(( child, ): child is NonNullable<typeof child> => !!child).toSorted(this.#sorter); if (!includingEntries.length) { return null; } return { type: "directory", metadata, directory: node, entries: entries.filter((child): child is NonNullable<typeof child> => !!child ).toSorted(this.#sorter), entries: includingEntries, path: [...parentPath, metadata.name], }; }
-