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

Method read

packages/platform/node-shared/src/NodeFileSystem.ts:412–422  ·  view source on GitHub ↗
(buffer: Uint8Array, options?: FileSystem.File.ReadOptions)

Source from the content-addressed store, hash-verified

410 }
411
412 read(buffer: Uint8Array, options?: FileSystem.File.ReadOptions) {
413 return Effect.suspend(() => {
414 const explicit = options?.position
415 if (explicit === undefined) {
416 return this.atCursor((position) => nodeRead(this.fd, { buffer, position }))
417 }
418 return explicit < BigInt(0)
419 ? Effect.fail(negativePosition("read"))
420 : nodeRead(this.fd, { buffer, position: explicit })
421 })
422 }
423
424 readAlloc(size: number, options?: FileSystem.File.ReadOptions) {
425 return Effect.suspend(() => {

Callers

nothing calls this directly

Calls 4

atCursorMethod · 0.95
negativePositionFunction · 0.85
failMethod · 0.65
BigIntInterface · 0.50

Tested by

no test coverage detected