MCPcopy
hub / github.com/Effect-TS/effect / isOutOfBounds

Function isOutOfBounds

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

Source from the content-addressed store, hash-verified

598export const length = <A>(self: ReadonlyArray<A>): number => self.length
599
600const isOutOfBounds = <A>(i: number, as: ReadonlyArray<A>): boolean => i < 0 || i >= as.length
601
602const clamp = <A>(i: number, as: ReadonlyArray<A>): number => Math.floor(Math.min(Math.max(0, i), as.length))
603

Callers 1

Array.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected