/** * Filter values from the `ImmutableArray`. * * @tsplus static ImmutableArray.Aspects filterWithIndex * @tsplus pipeable ImmutableArray filterWithIndex */ export function filterWithIndex( f: (i: number, a: A) => a is B ): (self: ImmutableArray) => ImmutableArray export function filterWithIndex( f: (i: number, a: A) => boolean ): (self: ImmutableArray) => ImmutableArray export function filterWithIndex(f: (i: number, a: A) => boolean) { return (self: ImmutableArray): ImmutableArray => new ImmutableArray(self.array.filter((a, i) => f(i, a))) }