I want to remove all null values from a object. Let's suppose:
const data = {
key1: 'ok',
key2: null,
key3: '', // should be removed too
key4: {
inner_key1: 'aaa',
inner_key2: null
}
}
What I did was this
const clean = R.reject(R.either(R.isNil, R.isEmpty))
And this work:
{"key1":"ok","key4":{"inner_key1":"aaa","inner_key2":null}}
Except for nested objects, as you can see, inner_key2 is present, and should be filtered out.
Using ramda, how can I remove this nested values too?