Security update for Core, with self-updated composer
[yaffs-website] / node_modules / grunt-legacy-util / node_modules / lodash / thru.js
1 /**
2  * This method is like `_.tap` except that it returns the result of `interceptor`.
3  * The purpose of this method is to "pass thru" values replacing intermediate
4  * results in a method chain.
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 the result of `interceptor`.
12  * @example
13  *
14  * _('  abc  ')
15  *  .chain()
16  *  .trim()
17  *  .thru(function(value) {
18  *    return [value];
19  *  })
20  *  .value();
21  * // => ['abc']
22  */
23 function thru(value, interceptor) {
24   return interceptor(value);
25 }
26
27 module.exports = thru;