You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey, I spotted strange behaviour when using keys with dots which is inconsistent and can crash validating config.
See example below:
constconfig=convict({test: {param: {doc: 'some nested parameter',format: String,default: 'foo',},},});// Example 1config.load({'test.param': 'bar'});config.validate({allowed: 'strict'});// passes validationconsole.log(config.get('test.param'));// prints out 'foo' - unexpected, since previous load should set the value or fail validation// in this example the validate would throw an error, key with dot should not be treated as path// Example 2config.load({'someOther.param': 'baz'});config.validate({allowed: 'warn'});// throws error - unexpected, should just print a warning/* the error:Uncaught Error: cannot find configuration param 'someOther.param' at walk ([...]/node_modules/convict/src/main.js:2:8321) at flatten ([...]/node_modules/convict/src/main.js:2:1400) at validate ([...]/node_modules/convict/src/main.js:2:2099) at Object.validate (/[...]/node_modules/convict/src/main.js:2:10481)*/
I'm using convict in version 6.2.4 and node v18.17.0.
The text was updated successfully, but these errors were encountered:
Hey, I spotted strange behaviour when using keys with dots which is inconsistent and can crash validating config.
See example below:
I'm using convict in version 6.2.4 and node v18.17.0.
The text was updated successfully, but these errors were encountered: