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

Method truncate

packages/platform/node-shared/src/NodeFileSystem.ts:329–338  ·  view source on GitHub ↗
(length?: FileSystem.SizeInput)

Source from the content-addressed store, hash-verified

327 }
328
329 truncate(length?: FileSystem.SizeInput) {
330 return Effect.map(nodeTruncate(this.fd, length ? Number(length) : undefined), () => {
331 if (!this.append) {
332 const len = BigInt(length ?? 0)
333 if (this.position > len) {
334 this.position = len
335 }
336 }
337 })
338 }
339
340 write(buffer: Uint8Array) {
341 return Effect.suspend(() => {

Callers

nothing calls this directly

Calls 3

NumberInterface · 0.50
BigIntInterface · 0.50
mapMethod · 0.45

Tested by

no test coverage detected