12 lines
289 B
JavaScript
Raw Normal View History

2025-04-23 09:34:08 +08: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;
});