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

Function collectAsyncIterable

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

Source from the content-addressed store, hash-verified

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

Callers 2

globFunction · 0.85
readDirectoryFunction · 0.85

Calls 3

handleErrorFunction · 0.90
pushMethod · 0.80
evaluateFunction · 0.50

Tested by

no test coverage detected