#2219 Validating directives agains list of legal configuration keys

This commit is contained in:
Knut Sveidqvist
2021-08-05 01:05:34 +02:00
parent 711fb7d748
commit 37fae09ce4
2 changed files with 26 additions and 10 deletions

View File

@@ -1142,4 +1142,15 @@ top of the chart
config.class.arrowMarkerAbsolute = config.arrowMarkerAbsolute;
config.git.arrowMarkerAbsolute = config.arrowMarkerAbsolute;
const keyify = (obj, prefix = '') =>
Object.keys(obj).reduce((res, el) => {
if( Array.isArray(obj[el]) ) {
return res;
} else if( typeof obj[el] === 'object' && obj[el] !== null ) {
return [...res, prefix + el, ...keyify(obj[el],'')];
}
return [...res, prefix + el];
}, []);
export const configKeys = keyify(config, '');
export default config;