Bug:Fix file validation issue
[vnfsdk/refrepo.git] / vnfmarket / src / main / webapp / vnfmarket / node_modules / form-data / node_modules / async / compose.js
1 'use strict';
2
3 Object.defineProperty(exports, "__esModule", {
4   value: true
5 });
6
7 var _seq = require('./seq');
8
9 var _seq2 = _interopRequireDefault(_seq);
10
11 var _rest = require('./internal/rest');
12
13 var _rest2 = _interopRequireDefault(_rest);
14
15 function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
16
17 /**
18  * Creates a function which is a composition of the passed asynchronous
19  * functions. Each function consumes the return value of the function that
20  * follows. Composing functions `f()`, `g()`, and `h()` would produce the result
21  * of `f(g(h()))`, only this version uses callbacks to obtain the return values.
22  *
23  * Each function is executed with the `this` binding of the composed function.
24  *
25  * @name compose
26  * @static
27  * @memberOf module:ControlFlow
28  * @method
29  * @category Control Flow
30  * @param {...Function} functions - the asynchronous functions to compose
31  * @returns {Function} an asynchronous function that is the composed
32  * asynchronous `functions`
33  * @example
34  *
35  * function add1(n, callback) {
36  *     setTimeout(function () {
37  *         callback(null, n + 1);
38  *     }, 10);
39  * }
40  *
41  * function mul3(n, callback) {
42  *     setTimeout(function () {
43  *         callback(null, n * 3);
44  *     }, 10);
45  * }
46  *
47  * var add1mul3 = async.compose(mul3, add1);
48  * add1mul3(4, function (err, result) {
49  *     // result now equals 15
50  * });
51  */
52 exports.default = (0, _rest2.default)(function (args) {
53   return _seq2.default.apply(null, args.reverse());
54 });
55 module.exports = exports['default'];