@mirei/ts-collections
    Preparing search index...

    Function disjointBy

    • Determines whether the key projections of source and other are mutually exclusive.

      Type Parameters

      • TElement

        Type of elements within the source iterable.

      • TSecond

        Type of elements within the other iterable.

      • TKey

        Key type produced by keySelector.

      • TSecondKey

        Key type produced by otherKeySelector.

      Parameters

      Returns boolean

      true when no projected keys intersect; otherwise, false.

      Re-throws any error encountered while iterating either iterable or executing the selector projections/comparator.

      When the default comparator is used, the implementation buffers the larger key collection in a Set and short-circuits as soon as an intersecting key is found. Supplying a custom comparator forces a full pairwise comparison, which may iterate both iterables repeatedly; prefer the default comparator when suitable.

      const left = [{ name: 'Alice' }, { name: 'Bella' }];
      const right = [{ name: 'Mel' }];
      const areDisjoint = disjointBy(left, right, p => p.name, p => p.name);
      console.log(areDisjoint); // true