| 1 | /** |
| 2 | * @since 2.0.0 |
| 3 | */ |
| 4 | |
| 5 | import type { NonEmptyArray } from "../Array.ts" |
| 6 | |
| 7 | /** @internal */ |
| 8 | export const isArrayNonEmpty = <A>(self: ReadonlyArray<A>): self is NonEmptyArray<A> => self.length > 0 |
| 9 | |
| 10 | /** @internal */ |
| 11 | export function replaceAt<A>(self: ReadonlyArray<A>, index: number, value: A): Array<A> { |
| 12 | const out = self.slice() |
| 13 | out[index] = value |
| 14 | return out |
| 15 | } |