Closed aariacarterweir closed 3 years ago
Hi, could you also provide sample data? If you have initially empty object as a value it's treated as a leaf also, so maybe it's filtered out as not a boolean.
No response, closing for now.
Sorry for not replying sooner, I found that this did what I needed it to do:
_.filterDeep(data, Boolean, { leavesOnly: true, onUndefined: { keepIfEmpty: true } })
Cool, welcome back if anything
Could just be how I've interpreted it, but:
_.filterDeep(arr, Boolean, { leavesOnly: true, onFalse: { keepIfEmpty: true } })
still removes empty objects