findWhere.js 291 B

123456789101112
  1. define(['./find', './matcher'], function (find, matcher) {
  2. // Convenience version of a common use case of `_.find`: getting the first
  3. // object containing specific `key:value` pairs.
  4. function findWhere(obj, attrs) {
  5. return find(obj, matcher(attrs));
  6. }
  7. return findWhere;
  8. });