mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-19 15:30:03 +02:00
Lint fixes
This commit is contained in:
@@ -18,7 +18,6 @@ export const updateCurrentConfig = (siteCfg, _directives) => {
|
|||||||
// let sCfg = assignWithDepth(defaultConfig, siteConfigDelta);
|
// let sCfg = assignWithDepth(defaultConfig, siteConfigDelta);
|
||||||
|
|
||||||
// Join directives
|
// Join directives
|
||||||
let themeVariables = {};
|
|
||||||
let sumOfDirectives = {};
|
let sumOfDirectives = {};
|
||||||
for (let i = 0; i < _directives.length; i++) {
|
for (let i = 0; i < _directives.length; i++) {
|
||||||
const d = _directives[i];
|
const d = _directives[i];
|
||||||
@@ -73,25 +72,7 @@ export const setSiteConfig = conf => {
|
|||||||
currentConfig = updateCurrentConfig(siteConfig, directives);
|
currentConfig = updateCurrentConfig(siteConfig, directives);
|
||||||
return siteConfig;
|
return siteConfig;
|
||||||
};
|
};
|
||||||
const deepCopyFunction = inObject => {
|
|
||||||
let outObject, value, key;
|
|
||||||
|
|
||||||
if (typeof inObject !== 'object' || inObject === null) {
|
|
||||||
return inObject; // Return the value if inObject is not an object
|
|
||||||
}
|
|
||||||
|
|
||||||
// Create an array or object to hold the values
|
|
||||||
outObject = Array.isArray(inObject) ? [] : {};
|
|
||||||
|
|
||||||
for (key in inObject) {
|
|
||||||
value = inObject[key];
|
|
||||||
|
|
||||||
// Recursively (deep) copy for nested objects, including arrays
|
|
||||||
outObject[key] = deepCopyFunction(value);
|
|
||||||
}
|
|
||||||
|
|
||||||
return outObject;
|
|
||||||
};
|
|
||||||
export const setSiteConfigDelta = conf => {
|
export const setSiteConfigDelta = conf => {
|
||||||
siteConfigDelta = assignWithDepth({}, conf);
|
siteConfigDelta = assignWithDepth({}, conf);
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user