isValid() {
    if (this.isStandard()) {
      // has an operator name and dimension or expression
      const dimension = this.dimension();
      if (!dimension && isExpression(this[1])) {
        return true;
      }
      const query = this.query();
      if (
        !dimension ||
        !(query && query.filterDimensionOptions().hasDimension(dimension))
      ) {
        return false;
      }
      const operator = this.operator();
      if (operator) {
        const args = this.arguments();
        // has the mininum number of arguments
        if (args.length < operator.fields.length) {
          return false;
        }
        // arguments are non-null/undefined
        if (!_.all(args, arg => arg != null)) {
          return false;
        }
      }
      return true;
    } else if (this.isSegment()) {
      return !!this.segment();
    } else if (this.isCustom()) {
      return true;
    }
    return false;
  }
/**
   * Returns true if the filter is valid
   */
Returns true if the filter is valid
Returns true if the filter is valid
isValid() {
    if (this.isStandard()) {
      const dimension = this.dimension();
      if (!dimension && isExpression(this[1])) {
        return true;
      }
      const query = this.query();
      if (
        !dimension ||
        !(query && query.filterDimensionOptions().hasDimension(dimension))
      ) {
        return false;
      }
      const operator = this.operator();
      if (operator) {
        const args = this.arguments();
        if (args.length < operator.fields.length) {
          return false;
        }
        if (!_.all(args, arg => arg != null)) {
          return false;
        }
      }
      return true;
    } else if (this.isSegment()) {
      return !!this.segment();
    } else if (this.isCustom()) {
      return true;
    }
    return false;
  }
isValid ( ) { if ( this . isStandard ( ) ) { const dimension = this . dimension ( ) ; if ( ! dimension && isExpression ( this [ 1 ] ) ) { return true ; } const query = this . query ( ) ; if ( ! dimension || ! ( query && query . filterDimensionOptions ( ) . hasDimension ( dimension ) ) ) { return false ; } const operator = this . operator ( ) ; if ( operator ) { const args = this . arguments ( ) ; if ( args . length < operator . fields . length ) { return false ; } if ( ! _ . all ( args , arg => arg != null ) ) { return false ; } } return true ; } else if ( this . isSegment ( ) ) { return ! ! this . segment ( ) ; } else if ( this . isCustom ( ) ) { return true ; } return false ; }
Returns true if the filter is valid
Returns true if the filter is valid
// has an operator name and dimension or expression // has the mininum number of arguments // arguments are non-null/undefined