From 646f7662d0d30a5505a3b8ec2cf21d90f10818b8 Mon Sep 17 00:00:00 2001 From: Sidharth Vinod Date: Mon, 7 Aug 2023 15:12:37 +0530 Subject: [PATCH] chore: Remove comments, cleanup Co-authored-by: Alois Klink Co-authored-by: Nikolay Rozhkov Co-authored-by: Yokozuna59 --- packages/mermaid/src/Diagram.ts | 12 +++++++----- .../src/diagrams/sequence/sequenceDiagram.spec.js | 3 --- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/packages/mermaid/src/Diagram.ts b/packages/mermaid/src/Diagram.ts index f4b1e2c4f..4da0a3a66 100644 --- a/packages/mermaid/src/Diagram.ts +++ b/packages/mermaid/src/Diagram.ts @@ -7,6 +7,8 @@ import { UnknownDiagramError } from './errors.js'; import { cleanupComments } from './diagram-api/comments.js'; import type { DetailedError } from './utils.js'; import type { MermaidConfig } from './config.type.js'; +import type { DiagramDefinition } from './diagram-api/types.js'; +import { D } from 'vitest/dist/types-198fd1d9.js'; export type ParseErrorFunction = (err: string | DetailedError | unknown, hash?: any) => void; @@ -16,10 +18,11 @@ export type ParseErrorFunction = (err: string | DetailedError | unknown, hash?: */ export class Diagram { type = 'graph'; - parser; - renderer; - db; - private init?: (config: MermaidConfig) => void; + parser: DiagramDefinition['parser']; + renderer: DiagramDefinition['renderer']; + db: DiagramDefinition['db']; + private init?: DiagramDefinition['init']; + private detectError?: UnknownDiagramError; constructor(public text: string) { this.text += '\n'; @@ -62,7 +65,6 @@ export class Diagram { if (this.init) { const config = configApi.getConfig(); this.init(config); - log.info('Initialized diagram ' + this.type, config); } this.parser.parse(this.text); } diff --git a/packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js b/packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js index 1b4c62e66..0b84fbe35 100644 --- a/packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js +++ b/packages/mermaid/src/diagrams/sequence/sequenceDiagram.spec.js @@ -172,8 +172,6 @@ describe('more than one sequence diagram', () => { describe('when parsing a sequenceDiagram', function () { beforeEach(function () { - // diagram.db = sequenceDb; - // diagram = new Diagram(` sequenceDiagram Alice->Bob:Hello Bob, how are you? @@ -2048,7 +2046,6 @@ describe('when rendering a sequenceDiagram with directives', () => { beforeEach(function () { mermaidAPI.reset(); - // diagram.db = sequenceDb; diagram.renderer.bounds.init(); });