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

Function prepend

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

Source from the content-addressed store, hash-verified

219 * @since 2.0.0
220 */
221export const prepend = <A>(self: MutableList<A>, message: A): void => {
222 self.head = {
223 array: [message],
224 mutable: true,
225 offset: 0,
226 next: self.head
227 }
228 if (!self.tail) self.tail = self.head
229 self.length++
230}
231
232/**
233 * Prepends all elements from an iterable to the beginning of the MutableList.

Callers 1

Array.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected