I have a schema which has the following entry:
const schema = {
dateFormat: {
type: 'string',
default: 'l',
enum: ['l', 'L', 'MMM DD, YYYY', 'ddd, l', 'ddd, L', 'ddd, MMM DD, YYYY']
}
}
I know config files are not meant to be hand edited, however, if the value of dateFormat
is changed to a value outside of what's specified in enum
, then an 'Uncaught Error' is thrown in console instead of clearing the config value to its default on app start:
Uncaught Error: Config schema violation: `dateFormat` should be equal to one of the allowed values
at ElectronStore._validate (..\node_modules\conf\index.js:154)
at ElectronStore.get store [as store] (..\node_modules\conf\index.js:441)
at new Conf (..\node_modules\conf\index.js:119)
at new ElectronStore (..\node_modules\electron-store\index.js:23)
at test.js:21
So far I have only had this issue when using the enum validation on a string type.
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too