lib/bit-field.js
/**
   * Checks if an instance has all the specified fields set to 1. Useful for bit flags.
   *
   * @param {...Field} fields names of the fields to check
   * @returns {boolean} whether all the specified fields are set in the instance
   * @example
   *
   * const SettingsFlags = BinariusFactory(['notify', 'premium', 'moderator']);
   * const settings = SettingsFlags([1, 0, 1]);
   * settings.has('notify', 'moderator');
   * //=> true
   * settings.has('notify', 'premium');
   * //=> false
   */
Checks if an instance has all the specified fields set to 1. Useful for bit flags.
@param {...Field} fields names of the fields to check
@returns {boolean} whether all the specified fields are set in the instance
@example


Checks if an instance has all the specified fields set to 1 . Useful for bit flags . @param { ... Field } fields names of the fields to check @returns { boolean } whether all the specified fields are set in the instance @example
has(...fields) {
    const { offsets, zero, one } = this.constructor;
    let mask = zero;
    for (let i = 0; i < fields.length; i++) {
      mask |= one << offsets[fields[i]];
    }
    mask |= this.value;
    return this.value === mask;
  }
has ( ... fields ) { const { offsets , zero , one } = this . constructor ; let mask = zero ; for ( let i = 0 ; i < fields . length ; i ++ ) { mask |= one << offsets [ fields [ i ] ] ; } mask |= this . value ; return this . value === mask ; }
Checks if an instance has all the specified fields set to 1.
Checks if an instance has all the specified fields set to 1 .