chore: Replace lodash with lodash-es

This commit is contained in:
Sidharth Vinod
2022-11-20 22:38:07 +05:30
parent 4411aa9905
commit 7d3a0577d2
7 changed files with 18 additions and 12 deletions

View File

@@ -59,7 +59,7 @@
"fast-clone": "^1.5.13",
"graphlib": "^2.1.8",
"khroma": "^2.0.0",
"lodash": "^4.17.21",
"lodash-es": "^4.17.21",
"moment-mini": "^2.24.0",
"non-layered-tidy-tree-layout": "^2.0.2",
"stylis": "^4.1.2",
@@ -69,7 +69,7 @@
"@types/d3": "^7.4.0",
"@types/dompurify": "^2.4.0",
"@types/jsdom": "^20.0.1",
"@types/lodash": "^4.14.188",
"@types/lodash-es": "^4.17.6",
"@types/micromatch": "^4.0.2",
"@types/prettier": "^2.7.1",
"@types/stylis": "^4.0.2",

View File

@@ -1,6 +1,6 @@
import flowDb from '../flowDb';
import flow from './flow';
import filter from 'lodash/filter';
import filter from 'lodash-es/filter';
import { setConfig } from '../../../config';
setConfig({

View File

@@ -1,6 +1,6 @@
import flowDb from '../flowDb';
import flow from './flow';
import filter from 'lodash/filter';
import filter from 'lodash-es/filter';
import { setConfig } from '../../../config';
setConfig({

View File

@@ -29,7 +29,7 @@ import utils, { directiveSanitizer } from './utils';
import DOMPurify from 'dompurify';
import { MermaidConfig } from './config.type';
import { evaluate } from './diagrams/common/common';
import isEmpty from 'lodash/isEmpty';
import isEmpty from 'lodash-es/isEmpty';
// diagram names that support classDef statements
const CLASSDEF_DIAGRAMS = ['graph', 'flowchart', 'flowchart-v2', 'stateDiagram', 'stateDiagram-v2'];

View File

@@ -3,7 +3,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/memoize';
import memoize from 'lodash-es/memoize';
addDiagrams();
describe('when assignWithDepth: should merge objects within objects', function () {

View File

@@ -21,7 +21,7 @@ import { log } from './logger';
import { detectType } from './diagram-api/detectType';
import assignWithDepth from './assignWithDepth';
import { MermaidConfig } from './config.type';
import memoize from 'lodash/memoize';
import memoize from 'lodash-es/memoize';
// Effectively an enum of the supported curve types, accessible by name
const d3CurveTypes = {

14
pnpm-lock.yaml generated
View File

@@ -187,7 +187,7 @@ importers:
khroma:
specifier: ^2.0.0
version: 2.0.0
lodash:
lodash-es:
specifier: ^4.17.21
version: 4.17.21
moment-mini:
@@ -212,9 +212,9 @@ importers:
'@types/jsdom':
specifier: ^20.0.1
version: 20.0.1
'@types/lodash':
specifier: ^4.14.188
version: 4.14.188
'@types/lodash-es':
specifier: ^4.17.6
version: 4.17.6
'@types/micromatch':
specifier: ^4.0.2
version: 4.0.2
@@ -2488,6 +2488,12 @@ packages:
resolution: {integrity: sha512-HZQYqbiFVWufzCwexrvh694SOim8z2d+xJl5UNamcvQFejLY/2YUtzXHYi3cHdI7PMlS8ejH2slRAOJQ32aNbA==}
dev: true
/@types/lodash-es/4.17.6:
resolution: {integrity: sha512-R+zTeVUKDdfoRxpAryaQNRKk3105Rrgx2CFRClIgRGaqDTdjsm8h6IYA8ir584W3ePzkZfst5xIgDwYrlh9HLg==}
dependencies:
'@types/lodash': 4.14.188
dev: true
/@types/lodash/4.14.188:
resolution: {integrity: sha512-zmEmF5OIM3rb7SbLCFYoQhO4dGt2FRM9AMkxvA3LaADOF1n8in/zGJlWji9fmafLoNyz+FoL6FE0SLtGIArD7w==}
dev: true