code: function baseStatePredicate(state, full) {
      if (full) {
          return this.extract(state);
      }
  
      // Cache a state predicate function
      const fn = getPredicateFunction(state);
  
      return this.flatten(node => {
          // Never include removed nodes unless specifically requested
          if (state !== 'removed' && node.removed()) {
              return false;
          }
  
          return fn(node);
      });
  }
docs: Base function to filter nodes by state value.
  
  @private
  @param {string} state State property
  @param {boolean} full Return a non-flat hierarchy
  @return {TreeNodes} Array of matching nodes.