bitwise-flag - v2.1.0
    Preparing search index...

    Function symmetricDifference

    • Returns a new flag box containing only flags that appear in exactly one of the input boxes. With 3+ boxes this is true set symmetric difference, not XOR chaining: a flag shared by any two boxes is excluded regardless of how many boxes contain it.

      Type Parameters

      • TFlags extends string
      • TBit extends Bit
      • TBrand extends string | symbol

      Parameters

      Returns Flag<TFlags, TBit, TBrand>

      if boxes belong to different registry instances.

      // Two boxes: flags unique to each side survive.
      symmetricDifference(registry.of("read", "write"), registry.of("write", "execute"));
      // → { read, execute } ("write" is shared → removed)

      // Three boxes: flags in 2+ boxes are removed.
      symmetricDifference(registry.of("read", "write"), registry.of("write", "execute"), registry.of("execute", "admin"));
      // → { read, admin } ("write" in boxes 1+2, "execute" in boxes 2+3 → both removed)