mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-02 16:17:50 +00:00
Revert allowing _.omit and _.pick to work as a callback for _.map when combined with _.partialRight to be solved with _.partial placeholders in v3.
This commit is contained in:
24
test/test.js
24
test/test.js
@@ -5807,18 +5807,6 @@
|
||||
test('should coerce property names to strings', 1, function() {
|
||||
deepEqual(_.omit({ '0': 'a' }, 0), {});
|
||||
});
|
||||
|
||||
test('should work when used as a callback for `_.map`', 2, function() {
|
||||
var callback = _.partialRight(_.omit, 'a'),
|
||||
objects = [{ '0': 0, 'a': 0 }, { '1': 1, 'a': 1 }],
|
||||
actual = _.map(objects, callback),
|
||||
expected = [{ '0': 0 }, { '1': 1 }];
|
||||
|
||||
deepEqual(actual, expected);
|
||||
|
||||
actual = _.map({ '0': objects[0], '1': objects[1] }, callback);
|
||||
deepEqual(actual, expected);
|
||||
});
|
||||
}('a', 'c'));
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
@@ -6236,18 +6224,6 @@
|
||||
test('should coerce property names to strings', 1, function() {
|
||||
deepEqual(_.pick({ '0': 'a', '1': 'b' }, 0), { '0': 'a' });
|
||||
});
|
||||
|
||||
test('should work when used as a callback for `_.map`', 2, function() {
|
||||
var callback = _.partialRight(_.pick, 'a'),
|
||||
objects = [{ '0': 0, 'a': 0 }, { '1': 1, 'a': 1 }],
|
||||
actual = _.map(objects, callback),
|
||||
expected = [{ 'a': 0 }, { 'a': 1 }];
|
||||
|
||||
deepEqual(actual, expected);
|
||||
|
||||
actual = _.map({ '0': objects[0], '1': objects[1] }, callback);
|
||||
deepEqual(actual, expected);
|
||||
});
|
||||
}('a', 'c'));
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
Reference in New Issue
Block a user