mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-07 18:07:49 +00:00
Bump to v3.1.0.
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
import baseCallback from '../internal/baseCallback';
|
||||
import isIterateeCall from '../internal/isIterateeCall';
|
||||
import isObjectLike from '../internal/isObjectLike';
|
||||
import matches from './matches';
|
||||
|
||||
/**
|
||||
* Creates a function bound to an optional `thisArg`. If `func` is a property
|
||||
@@ -40,7 +42,9 @@ function callback(func, thisArg, guard) {
|
||||
if (guard && isIterateeCall(func, thisArg, guard)) {
|
||||
thisArg = null;
|
||||
}
|
||||
return baseCallback(func, thisArg);
|
||||
return isObjectLike(func)
|
||||
? matches(func)
|
||||
: baseCallback(func, thisArg);
|
||||
}
|
||||
|
||||
export default callback;
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import baseClone from '../internal/baseClone';
|
||||
import baseMatches from '../internal/baseMatches';
|
||||
|
||||
/**
|
||||
@@ -26,7 +27,7 @@ import baseMatches from '../internal/baseMatches';
|
||||
* // => { 'user': 'barney', 'age': 36 }
|
||||
*/
|
||||
function matches(source) {
|
||||
return baseMatches(source, true);
|
||||
return baseMatches(baseClone(source, true));
|
||||
}
|
||||
|
||||
export default matches;
|
||||
|
||||
Reference in New Issue
Block a user