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

Function clampCount

packages/effect/src/Array.ts:1331–1331  ·  view source on GitHub ↗
(n: number, length: number)

Source from the content-addressed store, hash-verified

1329export const initNonEmpty = <A>(self: NonEmptyReadonlyArray<A>): Array<A> => self.slice(0, -1)
1330
1331const clampCount = (n: number, length: number): number => Math.min(Count.normalize(n), length)
1332
1333/**
1334 * Keeps the first `n` elements, creating a new array.

Callers 1

Array.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected