N.js 243 B

12345678910111213141516
  1. var arityFn = [
  2. require('./0'),
  3. require('./1'),
  4. require('./2'),
  5. require('./3'),
  6. require('./4'),
  7. require('./5')
  8. ];
  9. module.exports = function(fn, n) {
  10. if (n && n <= 5) {
  11. return arityFn[n](fn);
  12. } else {
  13. return fn;
  14. }
  15. };