mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-14 12:47:49 +00:00
Revert #2193.
This commit is contained in:
@@ -165,10 +165,6 @@ exports.methodRearg = {
|
||||
exports.methodSpread = {
|
||||
'invokeArgs': 2,
|
||||
'invokeArgsMap': 2,
|
||||
'over': 0,
|
||||
'overArgs': 1,
|
||||
'overEvery': 0,
|
||||
'overSome': 0,
|
||||
'partial': 1,
|
||||
'partialRight': 1,
|
||||
'without': 1
|
||||
|
||||
12
lodash.js
12
lodash.js
@@ -4608,7 +4608,7 @@
|
||||
*/
|
||||
function createOver(arrayFunc) {
|
||||
return rest(function(iteratees) {
|
||||
iteratees = arrayMap(iteratees, getIteratee());
|
||||
iteratees = arrayMap(baseFlatten(iteratees, 1), getIteratee());
|
||||
return rest(function(args) {
|
||||
var thisArg = this;
|
||||
return arrayFunc(iteratees, function(iteratee) {
|
||||
@@ -9592,7 +9592,7 @@
|
||||
* @memberOf _
|
||||
* @category Function
|
||||
* @param {Function} func The function to wrap.
|
||||
* @param {...Function} [transforms] The functions to transform
|
||||
* @param {...(Function|Function[])} [transforms] The functions to transform.
|
||||
* arguments, specified individually or in arrays.
|
||||
* @returns {Function} Returns the new function.
|
||||
* @example
|
||||
@@ -9616,7 +9616,7 @@
|
||||
* // => [100, 10]
|
||||
*/
|
||||
var overArgs = rest(function(func, transforms) {
|
||||
transforms = arrayMap(transforms, getIteratee());
|
||||
transforms = arrayMap(baseFlatten(transforms, 1), getIteratee());
|
||||
|
||||
var funcsLength = transforms.length;
|
||||
return rest(function(args) {
|
||||
@@ -14691,7 +14691,7 @@
|
||||
* @memberOf _
|
||||
* @since 4.0.0
|
||||
* @category Util
|
||||
* @param {...Function} iteratees The iteratees to invoke.
|
||||
* @param {...(Function|Function[])} iteratees The iteratees to invoke.
|
||||
* @returns {Function} Returns the new function.
|
||||
* @example
|
||||
*
|
||||
@@ -14710,7 +14710,7 @@
|
||||
* @memberOf _
|
||||
* @since 4.0.0
|
||||
* @category Util
|
||||
* @param {...Function} predicates The predicates to check.
|
||||
* @param {...(Function|Function[])} predicates The predicates to check.
|
||||
* @returns {Function} Returns the new function.
|
||||
* @example
|
||||
*
|
||||
@@ -14735,7 +14735,7 @@
|
||||
* @memberOf _
|
||||
* @since 4.0.0
|
||||
* @category Util
|
||||
* @param {...Function} predicates The predicates to check.
|
||||
* @param {...(Function|Function[])} predicates The predicates to check.
|
||||
* @returns {Function} Returns the new function.
|
||||
* @example
|
||||
*
|
||||
|
||||
21
test/test.js
21
test/test.js
@@ -15583,6 +15583,13 @@
|
||||
assert.deepEqual(over(5, 10), [10, 100]);
|
||||
});
|
||||
|
||||
QUnit.test('should flatten `transforms`', function(assert) {
|
||||
assert.expect(1);
|
||||
|
||||
var over = _.overArgs(fn, [doubled, square], String);
|
||||
assert.deepEqual(over(5, 10, 15), [10, 100, '15']);
|
||||
});
|
||||
|
||||
QUnit.test('should not transform any argument greater than the number of transforms', function(assert) {
|
||||
assert.expect(1);
|
||||
|
||||
@@ -16109,6 +16116,13 @@
|
||||
assert.strictEqual(over(object), false);
|
||||
});
|
||||
|
||||
QUnit.test('should flatten `predicates`', function(assert) {
|
||||
assert.expect(1);
|
||||
|
||||
var over = _.overEvery(alwaysTrue, [alwaysFalse]);
|
||||
assert.strictEqual(over(), false);
|
||||
});
|
||||
|
||||
QUnit.test('should provide arguments to predicates', function(assert) {
|
||||
assert.expect(1);
|
||||
|
||||
@@ -16204,6 +16218,13 @@
|
||||
assert.strictEqual(over(object), false);
|
||||
});
|
||||
|
||||
QUnit.test('should flatten `predicates`', function(assert) {
|
||||
assert.expect(1);
|
||||
|
||||
var over = _.overSome(alwaysFalse, [alwaysTrue]);
|
||||
assert.strictEqual(over(), true);
|
||||
});
|
||||
|
||||
QUnit.test('should provide arguments to predicates', function(assert) {
|
||||
assert.expect(1);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user