Skip to content

Commit

Permalink
remove cleanClone
Browse files Browse the repository at this point in the history
  • Loading branch information
sidharthv96 committed Aug 10, 2023
1 parent 396bda8 commit dfeb251
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 29 deletions.
24 changes: 0 additions & 24 deletions packages/mermaid/src/cleanClone.ts

This file was deleted.

10 changes: 5 additions & 5 deletions packages/mermaid/src/diagrams/pie/pieDb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import type { ParseDirectiveDefinition } from '../../diagram-api/types.js';
import type { PieFields, PieDB, Sections } from './pieTypes.js';
import type { RequiredDeep } from 'type-fest';
import type { PieDiagramConfig } from '../../config.type.js';
import { structuredCleanClone } from '../../cleanClone.js';
import { cleanAndMerge } from '../../utils.js';

export const DEFAULT_PIE_CONFIG: Required<PieDiagramConfig> = {
useMaxWidth: true,
Expand All @@ -31,24 +31,24 @@ export const DEFAULT_PIE_DB: RequiredDeep<PieFields> = {

let sections: Sections = DEFAULT_PIE_DB.sections;
let showData: boolean = DEFAULT_PIE_DB.showData;
let config: Required<PieDiagramConfig> = structuredCleanClone(DEFAULT_PIE_CONFIG);
let config: Required<PieDiagramConfig> = structuredClone(DEFAULT_PIE_CONFIG);

const setConfig = (conf: PieDiagramConfig): void => {
config = structuredCleanClone(DEFAULT_PIE_CONFIG, conf);
config = cleanAndMerge(DEFAULT_PIE_CONFIG, conf);
};

const getConfig = (): Required<PieDiagramConfig> => config;

const resetConfig = (): void => {
config = structuredCleanClone(DEFAULT_PIE_CONFIG);
config = structuredClone(DEFAULT_PIE_CONFIG);
};

const parseDirective: ParseDirectiveDefinition = (statement, context, type) => {
_parseDirective(this, statement, context, type);
};

const clear = (): void => {
sections = structuredCleanClone(DEFAULT_PIE_DB.sections);
sections = structuredClone(DEFAULT_PIE_DB.sections);
showData = DEFAULT_PIE_DB.showData;
commonClear();
resetConfig();
Expand Down

0 comments on commit dfeb251

Please sign in to comment.