Permalink
Cannot retrieve contributors at this time
29 lines (28 sloc)
703 Bytes
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
codeql-action/node_modules/lodash/tap.js
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* This method invokes `interceptor` and returns `value`. The interceptor | |
* is invoked with one argument; (value). The purpose of this method is to | |
* "tap into" a method chain sequence in order to modify intermediate results. | |
* | |
* @static | |
* @memberOf _ | |
* @since 0.1.0 | |
* @category Seq | |
* @param {*} value The value to provide to `interceptor`. | |
* @param {Function} interceptor The function to invoke. | |
* @returns {*} Returns `value`. | |
* @example | |
* | |
* _([1, 2, 3]) | |
* .tap(function(array) { | |
* // Mutate input array. | |
* array.pop(); | |
* }) | |
* .reverse() | |
* .value(); | |
* // => [2, 1] | |
*/ | |
function tap(value, interceptor) { | |
interceptor(value); | |
return value; | |
} | |
module.exports = tap; |