mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-07 01:57: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:
28
lodash.js
28
lodash.js
@@ -6432,18 +6432,10 @@
|
||||
* // => { 'name': 'fred' }
|
||||
*/
|
||||
function omit(object, callback, thisArg) {
|
||||
var result = {},
|
||||
type = typeof callback;
|
||||
var result = {};
|
||||
|
||||
if (type != 'function') {
|
||||
// enables use as a callback for functions like `_.map`
|
||||
// when combined with `_.partialRight`
|
||||
var args = arguments;
|
||||
if ((type == 'number' || type == 'string') && thisArg && thisArg[callback] === object) {
|
||||
args = slice(args);
|
||||
splice.call(args, 1, 2);
|
||||
}
|
||||
var omitProps = baseFlatten(args, true, false, 1),
|
||||
if (typeof callback != 'function') {
|
||||
var omitProps = baseFlatten(arguments, true, false, 1),
|
||||
length = omitProps.length;
|
||||
|
||||
while (length--) {
|
||||
@@ -6528,19 +6520,11 @@
|
||||
* // => { 'name': 'fred' }
|
||||
*/
|
||||
function pick(object, callback, thisArg) {
|
||||
var result = {},
|
||||
type = typeof callback;
|
||||
var result = {};
|
||||
|
||||
if (type != 'function') {
|
||||
// enables use as a callback for functions like `_.map`
|
||||
// when combined with `_.partialRight`
|
||||
var args = arguments;
|
||||
if ((type == 'number' || type == 'string') && thisArg && thisArg[callback] === object) {
|
||||
args = slice(args);
|
||||
splice.call(args, 1, 2);
|
||||
}
|
||||
if (typeof callback != 'function') {
|
||||
var index = -1,
|
||||
props = baseFlatten(args, true, false, 1),
|
||||
props = baseFlatten(arguments, true, false, 1),
|
||||
length = isObject(object) ? props.length : 0;
|
||||
|
||||
while (++index < length) {
|
||||
|
||||
Reference in New Issue
Block a user