mozilla / node-convict

Featureful configuration management library for Node.js
Other
2.35k stars 146 forks source link

Allow null additionally to any format #386

Closed maxwrlr closed 3 years ago

maxwrlr commented 3 years ago

Hello convicts,

the current options do not allow null additionally to any format. To get it working it was always necessary to create a new format around any existing format just to alloww null. What a mess!

This pull request tries to introduce the nullable option, which, if truthy, makes convict accept a configured null property before a dedicated format checking function would be called. This change doesn't affect existing behaviour.

This could also be seen as a fix for #292 .

madarche commented 3 years ago

Thanks @maxwrlr, this seems very good. Could you additionally just update the README file in your MR please?

maxwrlr commented 3 years ago

I adjusted the README. I hope what I wrote makes sense.

madarche commented 3 years ago

@maxwrlr thanks for the addition of the doc. It's good now 👍‍‍

madarche commented 3 years ago

@maxwrlr see #388