'use strict';12Object.defineProperty(exports, "__esModule", {3value: true4});5exports.default = compose;67var _seq = require('./seq.js');89var _seq2 = _interopRequireDefault(_seq);1011function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }1213/**14* Creates a function which is a composition of the passed asynchronous15* functions. Each function consumes the return value of the function that16* follows. Composing functions `f()`, `g()`, and `h()` would produce the result17* of `f(g(h()))`, only this version uses callbacks to obtain the return values.18*19* If the last argument to the composed function is not a function, a promise20* is returned when you call it.21*22* Each function is executed with the `this` binding of the composed function.23*24* @name compose25* @static26* @memberOf module:ControlFlow27* @method28* @category Control Flow29* @param {...AsyncFunction} functions - the asynchronous functions to compose30* @returns {Function} an asynchronous function that is the composed31* asynchronous `functions`32* @example33*34* function add1(n, callback) {35* setTimeout(function () {36* callback(null, n + 1);37* }, 10);38* }39*40* function mul3(n, callback) {41* setTimeout(function () {42* callback(null, n * 3);43* }, 10);44* }45*46* var add1mul3 = async.compose(mul3, add1);47* add1mul3(4, function (err, result) {48* // result now equals 1549* });50*/51function compose(...args) {52return (0, _seq2.default)(...args.reverse());53}54module.exports = exports['default'];5556