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

    Function difference

    • Returns a new flag box with the flags of first that are absent in every subsequent box (successive AND NOT). Non-commutative: difference(a, b) and difference(b, a) produce different results.

      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.

      const a = registry.of("read", "write", "execute");
      const b = registry.of("write");
      const result = difference(a, b);
      result.has("read"); // true
      result.has("write"); // false — stripped by b
      result.has("execute"); // true