mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-18 06:49:47 +02:00
#2219 Validating directives agains list of legal configuration keys
This commit is contained in:
@@ -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;
|
||||
|
Reference in New Issue
Block a user