]> gerrit.simantics Code Review - simantics/district.git/blob - org.simantics.maps.server/node/node-v4.8.0-win-x64/node_modules/npm/node_modules/node-gyp/node_modules/path-array/node_modules/array-index/node_modules/es6-symbol/node_modules/es5-ext/function/#/compose.js
Adding integrated tile server
[simantics/district.git] / org.simantics.maps.server / node / node-v4.8.0-win-x64 / node_modules / npm / node_modules / node-gyp / node_modules / path-array / node_modules / array-index / node_modules / es6-symbol / node_modules / es5-ext / function / # / compose.js
1 'use strict';
2
3 var callable = require('../../object/valid-callable')
4   , aFrom    = require('../../array/from')
5
6   , apply = Function.prototype.apply, call = Function.prototype.call
7   , callFn = function (arg, fn) { return call.call(fn, this, arg); };
8
9 module.exports = function (fn/*, …fnn*/) {
10         var fns, first;
11         if (!fn) callable(fn);
12         fns = [this].concat(aFrom(arguments));
13         fns.forEach(callable);
14         fns = fns.reverse();
15         first = fns[0];
16         fns = fns.slice(1);
17         return function (arg) {
18                 return fns.reduce(callFn, apply.call(first, this, arguments));
19         };
20 };