MCPcopy Create free account
hub / github.com/Effect-TS/effect / readDirectory

Function readDirectory

packages/platform/deno/src/DenoFileSystem.ts:398–409  ·  view source on GitHub ↗
(path, options)

Source from the content-addressed store, hash-verified

396 )
397
398const readDirectory: FileSystem.FileSystem["readDirectory"] = (path, options) => {
399 if (options?.recursive) {
400 return Effect.map(
401 collectAsyncIterable("readDirectory", path, () => walk(path)),
402 (entries) => entries.map((entry) => relative(path, entry.path)).filter(Boolean)
403 )
404 }
405 return Effect.map(
406 collectAsyncIterable("readDirectory", path, () => Deno.readDir(path)),
407 (entries) => entries.map((entry) => entry.name)
408 )
409}
410
411const readDirectoryEntries = (path: string) =>
412 Effect.map(

Callers

nothing calls this directly

Calls 5

collectAsyncIterableFunction · 0.85
relativeFunction · 0.85
walkFunction · 0.50
mapMethod · 0.45
filterMethod · 0.45

Tested by

no test coverage detected