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

Method writeOnce

packages/platform/node-shared/src/NodeFileSystem.ts:387–395  ·  view source on GitHub ↗
(method: string, write: typeof nodeWrite, buffer: Uint8Array)

Source from the content-addressed store, hash-verified

385 }
386
387 private writeOnce(method: string, write: typeof nodeWrite, buffer: Uint8Array) {
388 return this.append ?
389 Effect.suspend(() => write(this.fd, buffer, undefined)) :
390 this.atCursor((position) =>
391 position === null
392 ? write(this.fd, buffer, undefined)
393 : Effect.flatMap(positionToNumber(position, method), (position) => write(this.fd, buffer, position))
394 )
395 }
396
397 seek(offset: bigint, from: FileSystem.SeekMode) {
398 return Effect.suspend(() => {

Callers 2

writeMethod · 0.95
writeAllChunkMethod · 0.95

Calls 3

atCursorMethod · 0.95
positionToNumberFunction · 0.85
writeFunction · 0.70

Tested by

no test coverage detected