Closed borkdude closed 4 years ago
This library now has update-existing
, so perhaps select-existing
would be the better name?
@eraserhd Hi Jason. existing might not be the right name for something which doesn't select keys that do exist, but are nil?
@borkdude Oh, I did fail to read closely. Carry on...
I think the use-case for this might be a little narrow, but I'll take some time to consider this.
@weavejester That makes sense. I "needed" this function here:
where I wanted to merge with another map, where the other map is produced by select-keys, but I only want the extra keys if they are non-nil.
Maybe there's another good way to do it without using an elaborate (cond-> ...)
.
You could always write: (m/remove-vals nil? (select-keys m ks))
Would you be interested in a PR for this?