documentcloud / underscore-contrib

The brass buckles on Underscore's utility belt
MIT License
621 stars 117 forks source link

Support conjoin and disjoin methods for single elements #163

Closed jacobpurcell closed 9 years ago

jacobpurcell commented 10 years ago

The conjoin and disjoin methods create a function that applies multiple predicates to an array. This pull request is to allow the created function to also work on single objects (not just arrays).

Also refactored the conjoin and disjoin methods into createPredicateApplicator.

Note: this introduces a dependency on underscore.array.builders.js. I'm assuming that this is OK as there was already a dependency on underscore.function.arity.js, let me know if this is not the case.