]>
git.r.bdr.sh - rbdr/dotfiles/blob - atom/packages/vim-mode/node_modules/grim/node_modules/emissary/node_modules/es6-weak-map/node_modules/es5-ext/function/#/compose.js
1da5e01162dcf5ea52a08667045297e9fe847c07
3 var callable
= require('../../object/valid-callable')
4 , aFrom
= require('../../array/from')
6 , apply
= Function
.prototype.apply
, call
= Function
.prototype.call
7 , callFn = function (arg
, fn
) { return call
.call(fn
, this, arg
); };
9 module
.exports = function (fn
/*, …fnn*/) {
11 if (!fn
) callable(fn
);
12 fns
= [this].concat(aFrom(arguments
));
13 fns
.forEach(callable
);
17 return function (arg
) {
18 return fns
.reduce(callFn
, apply
.call(first
, this, arguments
));