code: function isValid (value, predicate, self) {
    if (predicate instanceof Function) {
      return predicate.call(self, value)
    }
  
    if (predicate instanceof RegExp) {
      return predicate.test(value)
    }
  
    return true
  }
docs: Validates input per predicate if predicate is a `Function` or `RegExp`.
  
  @param {*} value
  Value to check.
  
  @param {Function|RegExp} [predicate]
  Predicate to check value against.
  
  @param {Object} [self]
  Object context.
  
  @return {Boolean}
  Whether value is valid.