matcher.js 309 B

1234567891011
  1. import extendOwn from './extendOwn.js';
  2. import isMatch from './isMatch.js';
  3. // Returns a predicate for checking whether an object has a given set of
  4. // `key:value` pairs.
  5. export default function matcher(attrs) {
  6. attrs = extendOwn({}, attrs);
  7. return function(obj) {
  8. return isMatch(obj, attrs);
  9. };
  10. }