Reputation: 43591
Why does the following fail to return a function?
const isValid = both(not(isEmpty), is(Object));
The item is valid if it:
Upvotes: 2
Views: 1191
Reputation: 2289
As mentioned in my comment, not
is, ahem, not what you want.
Instead, try complement
:
const isValid = R.both(R.complement(R.isEmpty), R.is(Array));
console.log(isValid);
console.log(isValid([1,2,3]));
<script src="https://cdn.jsdelivr.net/npm/ramda@latest/dist/ramda.min.js"></script>
Upvotes: 5