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

Function isCanonicalArrayIndex

packages/effect/src/Array.ts:963–966  ·  view source on GitHub ↗
(key: string)

Source from the content-addressed store, hash-verified

961 * @internal
962 */
963export function isCanonicalArrayIndex(key: string): boolean {
964 const index = Number(key)
965 return String(index) === key && Number.isInteger(index) && index >= 0 && index < 2 ** 32 - 1
966}
967
968/** @internal */
969export function isOutOfBounds<A>(i: number, as: ReadonlyArray<A>): boolean {

Callers

nothing calls this directly

Calls 2

NumberFunction · 0.70
StringFunction · 0.70

Tested by

no test coverage detected