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

Method toChunk

packages/effect/src/internal/ringBuffer.ts:41–51  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

39 }
40
41 toChunk(): Chunk.Chunk<A> {
42 const begin = this.current - this.size
43 const newArray = begin < 0
44 ? [
45 ...this.array.slice(this.capacity + begin, this.capacity),
46 ...this.array.slice(0, this.current)
47 ]
48 : this.array.slice(begin, this.current)
49
50 return Chunk.fromIterable(newArray) as Chunk.Chunk<A>
51 }
52
53 private increment(): void {
54 if (this.size < this.capacity) {

Callers 6

List.test.tsFile · 0.80
TMap.test.tsFile · 0.80
TSet.test.tsFile · 0.80
emitOnStreamEndFunction · 0.80
readerFunction · 0.80
stream.tsFile · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected