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