Security update for Core, with self-updated composer
[yaffs-website] / node_modules / grunt-legacy-util / node_modules / lodash / tap.js
1 /**
2  * This method invokes `interceptor` and returns `value`. The interceptor
3  * is invoked with one argument; (value). The purpose of this method is to
4  * "tap into" a method chain in order to modify intermediate results.
5  *
6  * @static
7  * @memberOf _
8  * @category Seq
9  * @param {*} value The value to provide to `interceptor`.
10  * @param {Function} interceptor The function to invoke.
11  * @returns {*} Returns `value`.
12  * @example
13  *
14  * _([1, 2, 3])
15  *  .tap(function(array) {
16  *    // Mutate input array.
17  *    array.pop();
18  *  })
19  *  .reverse()
20  *  .value();
21  * // => [2, 1]
22  */
23 function tap(value, interceptor) {
24   interceptor(value);
25   return value;
26 }
27
28 module.exports = tap;