Skip to content

Commit

Permalink
redeclare config parameter add default value for each variable
Browse files Browse the repository at this point in the history
  • Loading branch information
Yokozuna59 committed Aug 10, 2023
1 parent d5f11fc commit f02dd0a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/mermaid/src/assignWithDepth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
): 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;
Expand Down

0 comments on commit f02dd0a

Please sign in to comment.