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

Function nodeWriteFactory

packages/platform/node-shared/src/NodeFileSystem.ts:324–333  ·  view source on GitHub ↗
(method: string)

Source from the content-addressed store, hash-verified

322 )
323
324 const nodeWriteFactory = (method: string) => {
325 const write = effectify(
326 NFS.write,
327 handleErrnoException("FileSystem", method),
328 handleBadArgument(method)
329 )
330 // Bun ignores `position` unless `offset` and `length` are given explicitly.
331 return (fd: number, buffer: Uint8Array, position: number | undefined) =>
332 write(fd, buffer, 0, buffer.length, position)
333 }
334 const nodeWrite = nodeWriteFactory("write")
335 const nodeWriteAll = nodeWriteFactory("writeAll")
336

Callers 1

NodeFileSystem.tsFile · 0.85

Calls 3

handleErrnoExceptionFunction · 0.90
handleBadArgumentFunction · 0.85
writeFunction · 0.70

Tested by

no test coverage detected