12 lines
289 B
JavaScript
Raw Permalink Normal View History

2024-10-15 23:05:53 +03:00
define(['./matcher', './filter'], function (matcher, filter) {
// Convenience version of a common use case of `_.filter`: selecting only
// objects containing specific `key:value` pairs.
function where(obj, attrs) {
return filter(obj, matcher(attrs));
}
return where;
});