function getPredicateFunction(predicate) {
    var fn = predicate;
    if (isString(predicate)) {
      fn = function fn(node) {
        return isFunction(node[predicate]) ? node[predicate]() : node[predicate];
      };
    }
    return fn;
  }
Creates a predicate function.

@private
@param {string|function} predicate Property name or custom function.
@return {function} Predicate function.