mermaid/src/config.js

20 lines
402 B
JavaScript
Raw Normal View History

import { assignWithDepth } from './utils';
2020-06-17 11:54:24 +02:00
const config = {};
2019-07-14 07:50:53 +02:00
export const setConfig = conf => {
assignWithDepth(config, conf);
2019-09-12 21:58:57 +02:00
};
export const getConfig = () => config;
export const reset = conf => {
Object.keys(config).forEach(key => delete config[key]);
assignWithDepth(config, conf, { clobber: true });
};
const configApi = {
setConfig,
getConfig,
reset
};
export default configApi;