module.exports = function cu(fn) {
  'use strict';
  var args = [].slice.call(arguments);

  if ('function' !== typeof fn) throw new Error('auto-curry: Invalid parameter. First parameter should be a function.');
  if ('function' === typeof fn && !fn.length) return fn;
  if (args.length - 1 >= fn.length) return fn.apply(this, args.slice(1));
  return function() {
    var tempArgs = args.concat([].slice.call(arguments));
    return cu.apply(this, tempArgs);
  };
};

module.exports = function cu(fn) {
  'use strict'

  var args = [].slice.call(arguments)
  var typeOfFn = typeof fn

  if ('function' !== typeOfFn) throw new Error('auto-curry: Invalid parameter. Expected function, received ' + typeOfFn)
  if (fn.length <= 1) return fn
  if (args.length - 1 >= fn.length) return fn.apply(this, args.slice(1))

  return function() {
    return cu.apply(this, args.concat([].slice.call(arguments)))
  };
};

Return unary fn as is and remove redundant checks
Return unary fn as is and remove redundant checks
