devtypes - v2.0.0
    Preparing search index...

    Type Alias EqualsAny<T>

    EqualsAny: T extends readonly [infer A, infer B, ...(infer Rest)]
        ? If<Equals<A, B>, true, EqualsAny<[B, ...Rest]>>
        : false

    Test whether any adjacent types in a tuple are strictly equal.

    Type Parameters

    • T extends readonly any[]

      Tuple of types to compare

    Evaluates to true if at least one pair of neighboring types in the tuple is strictly equal.

    Tuples with fewer than two elements always evaluate to false.

    type A = EqualsAny< [ string, number, string ] >;  // false
    type B = EqualsAny< [ string, string, number ] >; // true
    type C = EqualsAny< [ 1, 2, 3 ] >; // false