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

Function collectAsyncIterable

packages/platform/deno/src/DenoFileSystem.ts:34–48  ·  view source on GitHub ↗
(
  method: string,
  pathOrDescriptor: string | number | undefined,
  evaluate: () => AsyncIterable<A>
)

Source from the content-addressed store, hash-verified

32 }))
33
34const collectAsyncIterable = <A>(
35 method: string,
36 pathOrDescriptor: string | number | undefined,
37 evaluate: () => AsyncIterable<A>
38) =>
39 Effect.tryPromise({
40 try: async () => {
41 const values = new Array<A>()
42 for await (const value of evaluate()) {
43 values.push(value)
44 }
45 return values
46 },
47 catch: handleError("FileSystem", method, pathOrDescriptor)
48 })
49
50const access: FileSystem.FileSystem["access"] = (path, options) => {
51 if (!options?.readable && !options?.writable) {

Callers 2

readDirectoryFunction · 0.85
readDirectoryEntriesFunction · 0.85

Calls 3

handleErrorFunction · 0.90
pushMethod · 0.65
evaluateFunction · 0.50

Tested by

no test coverage detected