Closed JWahle closed 1 year ago
Yes I considered this. Things get complicated by the fact that json and yaml only have null
. A missing value is deserialized to undefined
in JS, but other deserializers may return something else. Camilladsp deserializes both missing values and null
to the Rust value None
. And when serializing all None
s become null
s.
Changing this is possible, but it means that the standard Option
type in Rust can't be used, and requires writing a custom (de)serializer. Not very tempting!
Ok, makes sense.
I just noticed, that in the
next20
default values in configs are expressed throughnull
values. Have you considered usingundefined
instead? Variables with valueundefined
will be omitted when serializing to JSON, so default values could be omitted from the config, when saved. Also, it is a general recommendation to use onlyundefined
in JavaScript/TypeScript and not usenull
- so just use one concept of nothingness and stick to it.