compose.js 310 B

1234567891011
  1. var restArgs = require('./restArgs');
  2. exports = restArgs(function(fnList) {
  3. return function() {
  4. var i = fnList.length - 1;
  5. var result = fnList[i].apply(this, arguments);
  6. while (i--) result = fnList[i].call(this, result);
  7. return result;
  8. };
  9. });
  10. module.exports = exports;