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

    Function add

    • Returns a new flag box with the specified flags added (bitwise OR). Idempotent: adding an already-set flag leaves the bits unchanged.

      Type Parameters

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

      Parameters

      Returns Flag<TFlags, TBit, TBrand>

      if any name is not registered.

      const box = registry.of("read");
      const result = add(box, "write", "execute");
      result.has("read"); // true
      result.has("write"); // true
      result.has("execute"); // true