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

Function append

packages/effect/src/MutableList.ts:189–198  ·  view source on GitHub ↗
(self: MutableList<A>, message: A)

Source from the content-addressed store, hash-verified

187 * @since 2.0.0
188 */
189export const append = <A>(self: MutableList<A>, message: A): void => {
190 if (!self.tail) {
191 self.head = self.tail = emptyBucket()
192 } else if (!self.tail.mutable) {
193 self.tail.next = emptyBucket()
194 self.tail = self.tail.next
195 }
196 self.tail!.array.push(message)
197 self.length++
198}
199
200/**
201 * Prepends an element to the beginning of the MutableList.

Callers

nothing calls this directly

Calls 2

emptyBucketFunction · 0.85
pushMethod · 0.80

Tested by

no test coverage detected