Urara-Blog/node_modules/.pnpm-store/v3/files/2e/3fb79a788f63d2d01e865bfb04a46c2ea7300167c997012a6be64a318e5d45111a8a6ec8c5f3a1a69ddc5e7a64686d628c934b11d01b0ac3a508edc9ff80d4
2022-08-14 01:14:53 +08:00

28 lines
674 B
Text

/**
* This method is like `_.tap` except that it returns the result of `interceptor`.
* The purpose of this method is to "pass thru" values replacing intermediate
* results in a method chain sequence.
*
* @static
* @memberOf _
* @since 3.0.0
* @category Seq
* @param {*} value The value to provide to `interceptor`.
* @param {Function} interceptor The function to invoke.
* @returns {*} Returns the result of `interceptor`.
* @example
*
* _(' abc ')
* .chain()
* .trim()
* .thru(function(value) {
* return [value];
* })
* .value();
* // => ['abc']
*/
function thru(value, interceptor) {
return interceptor(value);
}
module.exports = thru;