This release is 23 versions behind 1.4.9 — the latest version of @fedify/fedify. Jump to latest
Built and signed on GitHub ActionsBuilt and signed on GitHub Actions
Built and signed on GitHub Actions
An ActivityPub/fediverse server framework
import { toSet } from "jsr:@hongminhee/aitertools@^0.6.0"; import { assertEquals } from "jsr:@std/assert@^0.226.0"; import { join } from "jsr:@std/path@^1.0.6"; import { test } from "../testing/mod.ts"; import { readDirRecursive } from "./fs.ts"; test("readDirRecursive()", async () => { // Create a temporary directory that has fixtures in it: const dir = await Deno.makeTempDir(); await Deno.mkdir(join(dir, "a")); await Deno.writeTextFile(join(dir, "a", "aa.txt"), "aa"); await Deno.writeTextFile(join(dir, "a", "ab.txt"), "aa"); await Deno.mkdir(join(dir, "a", "aa")); await Deno.writeTextFile(join(dir, "a", "aa", "aaa.txt"), "aaa"); await Deno.mkdir(join(dir, "b")); await Deno.writeTextFile(join(dir, "b", "ba.txt"), "ba"); await Deno.writeTextFile(join(dir, "b", "bb.txt"), "bb"); // Read the directory recursively: assertEquals( await toSet(readDirRecursive(dir)), new Set([ join("a", "aa", "aaa.txt"), join("a", "aa.txt"), join("a", "ab.txt"), join("b", "ba.txt"), join("b", "bb.txt"), ]), ); });