mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-18 06:49:47 +02:00
redeclare config
parameter add default value for each variable
This commit is contained in:
@@ -28,9 +28,9 @@
|
|||||||
const assignWithDepth = (
|
const assignWithDepth = (
|
||||||
dst: any,
|
dst: any,
|
||||||
src: any,
|
src: any,
|
||||||
config: { depth: number; clobber: boolean } = { depth: 2, clobber: false }
|
{ depth = 2, clobber = false }: { depth: number; clobber: boolean } = { depth: 2, clobber: false }
|
||||||
): any => {
|
): any => {
|
||||||
const { depth, clobber } = config;
|
const config = Object.assign({ depth, clobber });
|
||||||
if (Array.isArray(src) && !Array.isArray(dst)) {
|
if (Array.isArray(src) && !Array.isArray(dst)) {
|
||||||
src.forEach((s) => assignWithDepth(dst, s, config));
|
src.forEach((s) => assignWithDepth(dst, s, config));
|
||||||
return dst;
|
return dst;
|
||||||
|
Reference in New Issue
Block a user