Fork me on GitHub
#malli
<
2022-11-10
>
Casey17:11:39

Is there a function in malli already that does something like (select-keys MySchema a-map) to make a map containing only the keys defined in the schema? I don't want to define a closed schema, but I also don't want to pass unknown keys further down

ikitommi18:11:36

there is an example of this in Malli readme, see https://github.com/metosin/malli#value-transformation

Casey18:11:45

(select-keys (mu/keys MySchema) value) does this

ikitommi18:11:12

e.g. me/strip-extra-keys-transformer, it's recursive

Casey18:11:42

Ah! I see, for use with (m/decode)