summaryrefslogtreecommitdiffstats
path: root/common/src/main/webapp/usageguide/appserver/node_modules/mongoose/node_modules/async/constant.js
diff options
context:
space:
mode:
Diffstat (limited to 'common/src/main/webapp/usageguide/appserver/node_modules/mongoose/node_modules/async/constant.js')
-rw-r--r--common/src/main/webapp/usageguide/appserver/node_modules/mongoose/node_modules/async/constant.js65
1 files changed, 65 insertions, 0 deletions
diff --git a/common/src/main/webapp/usageguide/appserver/node_modules/mongoose/node_modules/async/constant.js b/common/src/main/webapp/usageguide/appserver/node_modules/mongoose/node_modules/async/constant.js
new file mode 100644
index 0000000..d130ca6
--- /dev/null
+++ b/common/src/main/webapp/usageguide/appserver/node_modules/mongoose/node_modules/async/constant.js
@@ -0,0 +1,65 @@
+'use strict';
+
+Object.defineProperty(exports, "__esModule", {
+ value: true
+});
+
+var _baseRest = require('lodash/_baseRest');
+
+var _baseRest2 = _interopRequireDefault(_baseRest);
+
+var _initialParams = require('./internal/initialParams');
+
+var _initialParams2 = _interopRequireDefault(_initialParams);
+
+function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
+
+/**
+ * Returns a function that when called, calls-back with the values provided.
+ * Useful as the first function in a [`waterfall`]{@link module:ControlFlow.waterfall}, or for plugging values in to
+ * [`auto`]{@link module:ControlFlow.auto}.
+ *
+ * @name constant
+ * @static
+ * @memberOf module:Utils
+ * @method
+ * @category Util
+ * @param {...*} arguments... - Any number of arguments to automatically invoke
+ * callback with.
+ * @returns {Function} Returns a function that when invoked, automatically
+ * invokes the callback with the previous given arguments.
+ * @example
+ *
+ * async.waterfall([
+ * async.constant(42),
+ * function (value, next) {
+ * // value === 42
+ * },
+ * //...
+ * ], callback);
+ *
+ * async.waterfall([
+ * async.constant(filename, "utf8"),
+ * fs.readFile,
+ * function (fileData, next) {
+ * //...
+ * }
+ * //...
+ * ], callback);
+ *
+ * async.auto({
+ * hostname: async.constant("https://server.net/"),
+ * port: findFreePort,
+ * launchServer: ["hostname", "port", function (options, cb) {
+ * startServer(options, cb);
+ * }],
+ * //...
+ * }, callback);
+ */
+exports.default = (0, _baseRest2.default)(function (values) {
+ var args = [null].concat(values);
+ return (0, _initialParams2.default)(function (ignoredArgs, callback) {
+ return callback.apply(this, args);
+ });
+});
+module.exports = exports['default']; \ No newline at end of file