mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-01 23:57:49 +00:00
Move juxt, flow, and flowRight to the Utility category mapping.
This commit is contained in:
123
lodash.js
123
lodash.js
@@ -8147,67 +8147,6 @@
|
||||
return createWrapper(func, FLIP_FLAG);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a function that returns the result of invoking the provided
|
||||
* functions with the `this` binding of the created function, where each
|
||||
* successive invocation is supplied the return value of the previous.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Function
|
||||
* @param {...Function} [funcs] Functions to invoke.
|
||||
* @returns {Function} Returns the new function.
|
||||
* @example
|
||||
*
|
||||
* function square(n) {
|
||||
* return n * n;
|
||||
* }
|
||||
*
|
||||
* var addSquare = _.flow(_.add, square);
|
||||
* addSquare(1, 2);
|
||||
* // => 9
|
||||
*/
|
||||
var flow = createFlow();
|
||||
|
||||
/**
|
||||
* This method is like `_.flow` except that it creates a function that
|
||||
* invokes the provided functions from right to left.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Function
|
||||
* @param {...Function} [funcs] Functions to invoke.
|
||||
* @returns {Function} Returns the new function.
|
||||
* @example
|
||||
*
|
||||
* function square(n) {
|
||||
* return n * n;
|
||||
* }
|
||||
*
|
||||
* var addSquare = _.flowRight(square, _.add);
|
||||
* addSquare(1, 2);
|
||||
* // => 9
|
||||
*/
|
||||
var flowRight = createFlow(true);
|
||||
|
||||
/**
|
||||
* Creates a function that invokes `iteratees` with the arguments provided
|
||||
* to the created function and returns their results.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Function
|
||||
* @param {Function[]} iteratees The iteratees to invoke.
|
||||
* @returns {Function} Returns the new function.
|
||||
* @example
|
||||
*
|
||||
* var juxted = _.juxt(Math.max, Math.min);
|
||||
*
|
||||
* juxted(1, 2, 3, 4);
|
||||
* // => [4, 1]
|
||||
*/
|
||||
var juxt = createInvoker(arrayMap);
|
||||
|
||||
/**
|
||||
* Creates a function that memoizes the result of `func`. If `resolver` is
|
||||
* provided it determines the cache key for storing the result based on the
|
||||
@@ -12225,6 +12164,50 @@
|
||||
*/
|
||||
var disj = createInvoker(arraySome);
|
||||
|
||||
|
||||
/**
|
||||
* Creates a function that returns the result of invoking the provided
|
||||
* functions with the `this` binding of the created function, where each
|
||||
* successive invocation is supplied the return value of the previous.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Utility
|
||||
* @param {...(Function|Function[])} [funcs] Functions to invoke.
|
||||
* @returns {Function} Returns the new function.
|
||||
* @example
|
||||
*
|
||||
* function square(n) {
|
||||
* return n * n;
|
||||
* }
|
||||
*
|
||||
* var addSquare = _.flow(_.add, square);
|
||||
* addSquare(1, 2);
|
||||
* // => 9
|
||||
*/
|
||||
var flow = createFlow();
|
||||
|
||||
/**
|
||||
* This method is like `_.flow` except that it creates a function that
|
||||
* invokes the provided functions from right to left.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Utility
|
||||
* @param {...(Function|Function[])} [funcs] Functions to invoke.
|
||||
* @returns {Function} Returns the new function.
|
||||
* @example
|
||||
*
|
||||
* function square(n) {
|
||||
* return n * n;
|
||||
* }
|
||||
*
|
||||
* var addSquare = _.flowRight(square, _.add);
|
||||
* addSquare(1, 2);
|
||||
* // => 9
|
||||
*/
|
||||
var flowRight = createFlow(true);
|
||||
|
||||
/**
|
||||
* This method returns the first argument provided to it.
|
||||
*
|
||||
@@ -12284,6 +12267,24 @@
|
||||
: baseIteratee(func);
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a function that invokes `iteratees` with the arguments provided
|
||||
* to the created function and returns their results.
|
||||
*
|
||||
* @static
|
||||
* @memberOf _
|
||||
* @category Utility
|
||||
* @param {...(Function|Function[])} iteratees The iteratees to invoke.
|
||||
* @returns {Function} Returns the new function.
|
||||
* @example
|
||||
*
|
||||
* var juxted = _.juxt(Math.max, Math.min);
|
||||
*
|
||||
* juxted(1, 2, 3, 4);
|
||||
* // => [4, 1]
|
||||
*/
|
||||
var juxt = createInvoker(arrayMap);
|
||||
|
||||
/**
|
||||
* Creates a function that performs a deep partial comparison between a given
|
||||
* object and `source`, returning `true` if the given object has equivalent
|
||||
|
||||
Reference in New Issue
Block a user