matcher.js 327 B

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