mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-23 17:29:54 +02:00
fixed config for user configs
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
import { log } from '../../logger.js';
|
import { log } from '../../logger.js';
|
||||||
import { random } from '../../utils.js';
|
import { cleanAndMerge, random } from '../../utils.js';
|
||||||
|
import { getConfig as commonGetConfig } from '../../config.js';
|
||||||
import common from '../common/common.js';
|
import common from '../common/common.js';
|
||||||
import {
|
import {
|
||||||
setAccTitle,
|
setAccTitle,
|
||||||
@@ -37,12 +38,16 @@ interface GitGraphState {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const DEFAULT_GITGRAPH_CONFIG: Required<GitGraphDiagramConfig> = DEFAULT_CONFIG.gitGraph;
|
const DEFAULT_GITGRAPH_CONFIG: Required<GitGraphDiagramConfig> = DEFAULT_CONFIG.gitGraph;
|
||||||
|
const getConfig = (): Required<GitGraphDiagramConfig> => {
|
||||||
const mainBranchName = DEFAULT_GITGRAPH_CONFIG.mainBranchName;
|
const config = cleanAndMerge({
|
||||||
const mainBranchOrder = DEFAULT_GITGRAPH_CONFIG.mainBranchOrder;
|
...DEFAULT_GITGRAPH_CONFIG,
|
||||||
const config: Required<GitGraphDiagramConfig> = structuredClone(DEFAULT_GITGRAPH_CONFIG);
|
...commonGetConfig().gitGraph,
|
||||||
|
});
|
||||||
const getConfig = (): Required<GitGraphDiagramConfig> => structuredClone(config);
|
return config;
|
||||||
|
};
|
||||||
|
const config = getConfig();
|
||||||
|
const mainBranchName = config.mainBranchName;
|
||||||
|
const mainBranchOrder = config.mainBranchOrder;
|
||||||
|
|
||||||
const state = new ImperativeState<GitGraphState>(() => ({
|
const state = new ImperativeState<GitGraphState>(() => ({
|
||||||
commits: new Map(),
|
commits: new Map(),
|
||||||
|
Reference in New Issue
Block a user