effect-io-ai

Package: effect
Module: Tuple

Tuple.omit

Creates a new tuple with the elements at the specified indices removed.

When to use

Use to drop elements from a tuple by position.

Details

Elements not at the specified indices are kept in their original order.

Example (Removing elements by index)

import { Tuple } from "effect"

const result = Tuple.omit(["a", "b", "c", "d"], [1, 3])
console.log(result) // ["a", "c"]

See

Signature

declare const omit: { <const T extends ReadonlyArray<unknown>, const I extends ReadonlyArray<Indices<T>>>(indices: I): (self: T) => OmitTuple<T, I[number]>; <const T extends ReadonlyArray<unknown>, const I extends ReadonlyArray<Indices<T>>>(self: T, indices: I): OmitTuple<T, I[number]>; }

Source

Since v4.0.0