code: function toFunction(obj) {
    switch ({}.toString.call(obj)) {
      case '[object Object]':
        return objectToFunction(obj);
      case '[object Function]':
        return obj;
      case '[object String]':
        return stringToFunction(obj);
      case '[object RegExp]':
        return regexpToFunction(obj);
      default:
        return defaultToFunction(obj);
    }
  }
docs: Convert `obj` to a `Function`.
  
  @param {Mixed} obj
  @return {Function}
  @api private