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

Method truncate

packages/platform/deno/src/DenoFileSystem.ts:263–273  ·  view source on GitHub ↗
(length?: FileSystem.SizeInput)

Source from the content-addressed store, hash-verified

261 }
262
263 truncate(length?: FileSystem.SizeInput) {
264 const size = FileSystem.Size(length ?? 0)
265 return Effect.map(
266 tryPromise("truncate", undefined, () => this.file.truncate(Number(size))),
267 () => {
268 if (!this.append && this.position > size) {
269 this.position = size
270 }
271 }
272 )
273 }
274
275 private writeChunk(method: string, buffer: Uint8Array) {
276 return Effect.suspend(() => {

Callers 3

truncateFunction · 0.45
BigDecimal.test.tsFile · 0.45
testLayerFunction · 0.45

Calls 3

tryPromiseFunction · 0.70
NumberInterface · 0.50
mapMethod · 0.45

Tested by

no test coverage detected