mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-05 01:17:50 +00:00
Bump to v3.1.0.
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
var baseCallback = require('../internal/baseCallback'),
|
||||
isIterateeCall = require('../internal/isIterateeCall');
|
||||
isIterateeCall = require('../internal/isIterateeCall'),
|
||||
isObjectLike = require('../internal/isObjectLike'),
|
||||
matches = require('./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);
|
||||
}
|
||||
|
||||
module.exports = callback;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
var baseMatches = require('../internal/baseMatches');
|
||||
var baseClone = require('../internal/baseClone'),
|
||||
baseMatches = require('../internal/baseMatches');
|
||||
|
||||
/**
|
||||
* Creates a function which performs a deep comparison between a given object
|
||||
@@ -26,7 +27,7 @@ var baseMatches = require('../internal/baseMatches');
|
||||
* // => { 'user': 'barney', 'age': 36 }
|
||||
*/
|
||||
function matches(source) {
|
||||
return baseMatches(source, true);
|
||||
return baseMatches(baseClone(source, true));
|
||||
}
|
||||
|
||||
module.exports = matches;
|
||||
|
||||
Reference in New Issue
Block a user