effect-io-ai

Package: effect
Module: Array

Array.dedupeAdjacentWith

Deduplicates adjacent elements that are identical using the provided isEquivalent function.

Example

import { Array } from "effect"

const result = Array.dedupeAdjacentWith([1, 1, 2, 2, 3, 3], (a, b) => a === b)
console.log(result) // [1, 2, 3]

Signature

declare const dedupeAdjacentWith: { <A>(isEquivalent: (self: A, that: A) => boolean): (self: Iterable<A>) => Array<A>; <A>(self: Iterable<A>, isEquivalent: (self: A, that: A) => boolean): Array<A>; }

Source

Since v2.0.0