Skip to content

Commit 1b1b858

Browse files
♻️ refactor: Use arrow functions everywhere.
1 parent 8a74a0e commit 1b1b858

File tree

2 files changed

+12
-18
lines changed

2 files changed

+12
-18
lines changed

src/conjunctions.js

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
// Could use recursion
2+
export const conjunctions = (predicates) => (input) => {
3+
for (const predicate of predicates) {
4+
if (!predicate(input)) return false;
5+
}
26

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+
};

src/disjunctions.js

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
11
// Could use recursion
2+
export const disjunctions = (predicates) => (input) => {
3+
for (const predicate of predicates) {
4+
if (predicate(input)) return true;
5+
}
26

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+
};

0 commit comments

Comments
 (0)