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

Function init

packages/effect/src/Array.ts:1302–1305  ·  view source on GitHub ↗
(self: Iterable<A>)

Source from the content-addressed store, hash-verified

1300 * @since 2.0.0
1301 */
1302export function init<A>(self: Iterable<A>): Option.Option<Array<A>> {
1303 const as = fromIterable(self)
1304 return isReadonlyArrayNonEmpty(as) ? Option.some(initNonEmpty(as)) : Option.none()
1305}
1306
1307/**
1308 * Returns all elements except the last of a `NonEmptyReadonlyArray`.

Callers

nothing calls this directly

Calls 3

initNonEmptyFunction · 0.85
someMethod · 0.80
fromIterableFunction · 0.70

Tested by

no test coverage detected