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

Function last

packages/effect/src/Array.ts:1127–1128  ·  view source on GitHub ↗
(self: ReadonlyArray<A>)

Source from the content-addressed store, hash-verified

1125 * @since 2.0.0
1126 */
1127export const last = <A>(self: ReadonlyArray<A>): Option.Option<A> =>
1128 isReadonlyArrayNonEmpty(self) ? Option.some(lastNonEmpty(self)) : Option.none()
1129
1130/**
1131 * Returns the last element of a `NonEmptyReadonlyArray` directly (no `Option`

Callers

nothing calls this directly

Calls 2

lastNonEmptyFunction · 0.85
someMethod · 0.80

Tested by

no test coverage detected