File tree 2 files changed +12
-18
lines changed
2 files changed +12
-18
lines changed Original file line number Diff line number Diff line change 1
1
// Could use recursion
2
+ export const conjunctions = ( predicates ) => ( input ) => {
3
+ for ( const predicate of predicates ) {
4
+ if ( ! predicate ( input ) ) return false ;
5
+ }
2
6
3
- export function conjunctions ( predicates ) {
4
- return function ( input ) {
5
- for ( const predicate of predicates ) {
6
- if ( ! predicate ( input ) ) return false ;
7
- }
8
-
9
- return true ;
10
- } ;
11
- }
7
+ return true ;
8
+ } ;
Original file line number Diff line number Diff line change 1
1
// Could use recursion
2
+ export const disjunctions = ( predicates ) => ( input ) => {
3
+ for ( const predicate of predicates ) {
4
+ if ( predicate ( input ) ) return true ;
5
+ }
2
6
3
- export function disjunctions ( predicates ) {
4
- return function ( input ) {
5
- for ( const predicate of predicates ) {
6
- if ( predicate ( input ) ) return true ;
7
- }
8
-
9
- return false ;
10
- } ;
11
- }
7
+ return false ;
8
+ } ;
You can’t perform that action at this time.
0 commit comments