MCPcopy Index your code
hub / github.com/Effect-TS/effect / init

Function init

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

Source from the content-addressed store, hash-verified

756 * @since 2.0.0
757 */
758export const init = <A>(self: Iterable<A>): Option.Option<Array<A>> => {
759 const input = fromIterable(self)
760 return isNonEmptyReadonlyArray(input) ? Option.some(initNonEmpty(input)) : Option.none()
761}
762
763/**
764 * Get all but the last element of a non empty array, creating a new array.

Callers

nothing calls this directly

Calls 2

initNonEmptyFunction · 0.85
fromIterableFunction · 0.70

Tested by

no test coverage detected