addFormat(name, validate) accepts regex for name#329
addFormat(name, validate) accepts regex for name#329A-312 wants to merge 1 commit intomozilla:masterfrom A-312:regexSupport
Conversation
|
I forgot to add documentation in README 😢 |
|
Thank you a lot for this PR. But sorry I think this brings complexity in the convict code, while providing not much added value. The same functionality provided by this PR can be achieved by registering multiple formats, which can be done by a custom module/lib. My main objectives with convict is to keep it safe and as simple as possible to use and to maintain. |
I only add two loops enabled when Add 10 formats then 1 is enough, is not maintainable on my side. I prefere to code dynamically (add a loop) instead copy/paste the same line/function. And this PR allow list format, whitout copy/paste 10 formats. Also I can make a hack like this : but i think format like 'Array[String]' is more readable than format & subformat key. I think also you can close #342 because is the same way to do. On my eye, this PR open the same opening that 342 but for format. I replaced (in 342) existing getters functions, I mean : importArguments, importEnvironment, addDefaultValues. By only one function which works dynamically. Now people will choose how they can get value or import arg/env variables. And i would like to know. Did you refuse because you have less time than before for convict ? |
Fix: #312
Q/A :
Add format with regex name.