From d2e7b1e56f551d776e89be077313674141a00103 Mon Sep 17 00:00:00 2001 From: Sidharth Vinod Date: Fri, 9 Sep 2022 16:58:48 +0530 Subject: [PATCH] fix: Support treeshaking --- package.json | 1 + src/utils.spec.js | 2 +- src/utils.ts | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 5e321f294..e1709730e 100644 --- a/package.json +++ b/package.json @@ -73,6 +73,7 @@ "fast-clone": "^1.5.13", "graphlib": "^2.1.8", "khroma": "^2.0.0", + "lodash": "^4.17.21", "moment-mini": "^2.24.0", "non-layered-tidy-tree-layout": "^2.0.2", "stylis": "^4.0.10" diff --git a/src/utils.spec.js b/src/utils.spec.js index 6ffbd3af1..d024da3db 100644 --- a/src/utils.spec.js +++ b/src/utils.spec.js @@ -2,7 +2,7 @@ import utils from './utils'; import assignWithDepth from './assignWithDepth'; import { detectType } from './diagram-api/detectType'; import { addDiagrams } from './diagram-api/diagram-orchestration'; -import { memoize } from 'lodash'; +import memoize from 'lodash/memoize'; addDiagrams(); describe('when assignWithDepth: should merge objects within objects', function () { diff --git a/src/utils.ts b/src/utils.ts index 200032435..7cd700e85 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -20,7 +20,7 @@ import { log } from './logger'; import { detectType } from './diagram-api/detectType'; import assignWithDepth from './assignWithDepth'; import { MermaidConfig } from './config.type'; -import { memoize } from 'lodash'; +import memoize from 'lodash/memoize'; // Effectively an enum of the supported curve types, accessible by name const d3CurveTypes = {