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

Function isOutOfBounds

packages/effect/src/Array.ts:969–971  ·  view source on GitHub ↗
(i: number, as: ReadonlyArray<A>)

Source from the content-addressed store, hash-verified

967
968/** @internal */
969export function isOutOfBounds<A>(i: number, as: ReadonlyArray<A>): boolean {
970 return !Number.isFinite(i) || i < 0 || i >= as.length
971}
972
973/**
974 * Reads an element at the given index safely, returning `Option.some` or

Callers 1

Array.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected