Fork me on GitHub
#specter
<
2017-08-03
>
steveb8n00:08:00

I’m struggling with a conditional transform. seems simple but I can’t work it out. How do I transform a map value only if it is present?

steveb8n00:08:18

(transform [:b vector?] set {:a 1})

steveb8n00:08:44

will return {:a 1, :b nil}

steveb8n00:08:17

but I only want the “:b” transformed if “:b” is present

steveb8n00:08:54

thanks @schmee I knew there had to be a simple answer