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

Function prependAllUnsafe

packages/effect/src/MutableList.ts:315–327  ·  view source on GitHub ↗
(self: MutableList<A>, messages: ReadonlyArray<A>, mutable = false)

Source from the content-addressed store, hash-verified

313 * @since 4.0.0
314 */
315export const prependAllUnsafe = <A>(self: MutableList<A>, messages: ReadonlyArray<A>, mutable = false): void => {
316 if (messages.length === 0) {
317 return
318 }
319 self.head = {
320 array: messages as Array<A>,
321 mutable,
322 offset: 0,
323 next: self.head
324 }
325 if (!self.tail) self.tail = self.head
326 self.length += self.head.array.length
327}
328
329/**
330 * Appends all elements from an iterable to the end of the MutableList.

Callers 1

prependAllFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected